Class: Rbxl::Row

Inherits:
Object
  • Object
show all
Defined in:
lib/rbxl/row.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(index:, cells:) ⇒ Row

Returns a new instance of Row.



5
6
7
8
9
# File 'lib/rbxl/row.rb', line 5

def initialize(index:, cells:)
  @index = index
  @cells = cells.freeze
  @values = nil
end

Instance Attribute Details

#cellsObject (readonly)

Returns the value of attribute cells.



3
4
5
# File 'lib/rbxl/row.rb', line 3

def cells
  @cells
end

#indexObject (readonly)

Returns the value of attribute index.



3
4
5
# File 'lib/rbxl/row.rb', line 3

def index
  @index
end

Instance Method Details

#[](offset) ⇒ Object



11
12
13
# File 'lib/rbxl/row.rb', line 11

def [](offset)
  cells[offset]
end

#sizeObject



19
20
21
# File 'lib/rbxl/row.rb', line 19

def size
  cells.size
end

#valuesObject



15
16
17
# File 'lib/rbxl/row.rb', line 15

def values
  @values ||= cells.map(&:value).freeze
end