Class: RT::RTCell

### Home Classes Methods

### In Files

- lib/rt/rtparser.rb

### Parent

Object

### Methods

- ::new
- #==
- #inspect

### Class/Module Index

Quicksearch

- RT
- RT::RT2HTMLVisitor
- RT::RT2TXTVisitor
- RT::RTCell
- RT::RTParser
- RT::RTVisitor
- W3M

No matching classes.

# RT::RTCell

### Attributes

align[R]
colspan[RW]
rowspan[RW]
value[R]

### Public Class Methods

new(value, align = nil) click to toggle source

    # File lib/rt/rtparser.rb, line 8
    def initialize(value, align = nil)
      @rowspan = @colspan = 1
      @value = value
      @align = case align       # {:left, :center :right}
               when :left, :center, :right
                 align
               when nil
                 if /^[+\-]?[0-9]+\.?[0-9]*/ === value
                   :right
                 else
                   :left
                 end
               else
                 raise "[BUG]Illegal align type"
               end
    end

### Public Instance Methods

==(x) click to toggle source

    # File lib/rt/rtparser.rb, line 24
    def == (x)
      case x
      when self.class
        self.value == "" && x.value == "" || self.value == x.value && self.align == x.align
      else
        false
      end
    end

inspect() click to toggle source

    # File lib/rt/rtparser.rb, line 32
    def inspect
      if value==""
        "()"
      else
        a = case align
            when :left
              "l"
            when :center
              "c"
            when :right
              "r"
            else
              raise "[BUG]Illegal align type"
            end
        "#{a}(#{value})"
      end
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.