Class: Sheetah::Sheet::Header

Inherits:
Object
  • Object
show all
Defined in:
lib/sheetah/sheet.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(col:, value:) ⇒ Header

Returns a new instance of Header.



48
49
50
51
# File 'lib/sheetah/sheet.rb', line 48

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

Instance Attribute Details

#colObject (readonly)

Returns the value of attribute col.



53
54
55
# File 'lib/sheetah/sheet.rb', line 53

def col
  @col
end

#valueObject (readonly)

Returns the value of attribute value.



53
54
55
# File 'lib/sheetah/sheet.rb', line 53

def value
  @value
end

Instance Method Details

#==(other) ⇒ Object



55
56
57
# File 'lib/sheetah/sheet.rb', line 55

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

#row_value_indexObject



59
60
61
# File 'lib/sheetah/sheet.rb', line 59

def row_value_index
  Sheet.col2int(col) - 1
end