Class: Rrxcell::Sheet

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

Direct Known Subclasses

Excel::Sheet, Excelx::Sheet

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(book, position) ⇒ Sheet

Returns a new instance of Sheet.



4
5
6
7
8
# File 'lib/rrxcell/sheet.rb', line 4

def initialize(book, position)
  super()
  @book = book
  @position = position
end

Instance Attribute Details

#bookObject (readonly)

Returns the value of attribute book.



2
3
4
# File 'lib/rrxcell/sheet.rb', line 2

def book
  @book
end

#positionObject (readonly)

Returns the value of attribute position.



2
3
4
# File 'lib/rrxcell/sheet.rb', line 2

def position
  @position
end

Instance Method Details

#[](row_position) ⇒ Object



10
11
12
# File 'lib/rrxcell/sheet.rb', line 10

def [](row_position)
  row(row_position)
end

#address(cell_address) ⇒ Object



14
15
16
17
18
# File 'lib/rrxcell/sheet.rb', line 14

def address(cell_address)
  row_position, column_position = Rrxcell::Addressing.cell_address_to_row_column_position(cell_address)
  
  row(row_position).column(column_position)
end

#nameObject



20
21
22
# File 'lib/rrxcell/sheet.rb', line 20

def name
  book.sheet_names[position]
end

#objectObject



24
25
26
# File 'lib/rrxcell/sheet.rb', line 24

def object
  raise ShouldBeImplementedError
end

#row(row_position) ⇒ Object



28
29
30
# File 'lib/rrxcell/sheet.rb', line 28

def row(row_position)
  raise ShouldBeImplementedError
end