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.



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

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

Instance Attribute Details

#colObject (readonly)

Returns the value of attribute col.



57
58
59
# File 'lib/sheetah/sheet.rb', line 57

def col
  @col
end

#valueObject (readonly)

Returns the value of attribute value.



57
58
59
# File 'lib/sheetah/sheet.rb', line 57

def value
  @value
end

Instance Method Details

#==(other) ⇒ Object



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

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

#row_value_indexObject



63
64
65
# File 'lib/sheetah/sheet.rb', line 63

def row_value_index
  Sheet.col2int(col) - 1
end