Class: RgGen::SpreadsheetLoader::Spreadsheet::Position
- Inherits:
-
Object
- Object
- RgGen::SpreadsheetLoader::Spreadsheet::Position
- Defined in:
- lib/rggen/spreadsheet_loader/spreadsheet/position.rb
Instance Attribute Summary collapse
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#sheet ⇒ Object
readonly
Returns the value of attribute sheet.
Instance Method Summary collapse
- #column ⇒ Object
-
#initialize(file, sheet, row, column) ⇒ Position
constructor
A new instance of Position.
- #row ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(file, sheet, row, column) ⇒ Position
Returns a new instance of Position.
7 8 9 10 11 12 |
# File 'lib/rggen/spreadsheet_loader/spreadsheet/position.rb', line 7 def initialize(file, sheet, row, column) @file = file @sheet = sheet @row = row @column = column end |
Instance Attribute Details
#file ⇒ Object (readonly)
Returns the value of attribute file.
14 15 16 |
# File 'lib/rggen/spreadsheet_loader/spreadsheet/position.rb', line 14 def file @file end |
#sheet ⇒ Object (readonly)
Returns the value of attribute sheet.
15 16 17 |
# File 'lib/rggen/spreadsheet_loader/spreadsheet/position.rb', line 15 def sheet @sheet end |
Instance Method Details
#column ⇒ Object
21 22 23 |
# File 'lib/rggen/spreadsheet_loader/spreadsheet/position.rb', line 21 def column @column.times.inject('A') { |l, _| l.next } end |
#row ⇒ Object
17 18 19 |
# File 'lib/rggen/spreadsheet_loader/spreadsheet/position.rb', line 17 def row @row + 1 end |
#to_s ⇒ Object
25 26 27 |
# File 'lib/rggen/spreadsheet_loader/spreadsheet/position.rb', line 25 def to_s "file: #{file} sheet: #{sheet} row: #{row} column: #{column}" end |