Class: Tabulard::Adapters::Xlsx::Cols

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(first_col:, last_col:) ⇒ Cols

Returns a new instance of Cols.



165
166
167
168
169
170
171
# File 'lib/tabulard/adapters/xlsx.rb', line 165

def initialize(first_col:, last_col:)
  cols_offset = first_col - 1

  @first_col = first_col
  @first_name = first_col
  @count = last_col - cols_offset
end

Instance Attribute Details

#countObject (readonly)

Returns the value of attribute count.



173
174
175
# File 'lib/tabulard/adapters/xlsx.rb', line 173

def count
  @count
end

Instance Method Details

#coord(col) ⇒ Object



179
180
181
# File 'lib/tabulard/adapters/xlsx.rb', line 179

def coord(col)
  @first_col + col
end

#name(col) ⇒ Object



175
176
177
# File 'lib/tabulard/adapters/xlsx.rb', line 175

def name(col)
  Table.int2col(@first_name + col)
end