Class: Tabulard::Table::Header

Inherits:
Object
  • Object
show all
Defined in:
lib/tabulard/table.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(col:, value:) ⇒ Header

Returns a new instance of Header.



55
56
57
58
# File 'lib/tabulard/table.rb', line 55

def initialize(col:, value:)
  @col = col
  @value = value
end

Instance Attribute Details

#colObject (readonly)

Returns the value of attribute col.



60
61
62
# File 'lib/tabulard/table.rb', line 60

def col
  @col
end

#valueObject (readonly)

Returns the value of attribute value.



60
61
62
# File 'lib/tabulard/table.rb', line 60

def value
  @value
end

Instance Method Details

#==(other) ⇒ Object



62
63
64
# File 'lib/tabulard/table.rb', line 62

def ==(other)
  other.is_a?(self.class) && col == other.col && value == other.value
end

#row_value_indexObject



66
67
68
# File 'lib/tabulard/table.rb', line 66

def row_value_index
  Table.col2int(col) - 1
end