Class: Rbxl::Row
- Inherits:
-
Object
- Object
- Rbxl::Row
- Defined in:
- lib/rbxl/row.rb
Instance Attribute Summary collapse
-
#cells ⇒ Object
readonly
Returns the value of attribute cells.
-
#index ⇒ Object
readonly
Returns the value of attribute index.
Instance Method Summary collapse
- #[](offset) ⇒ Object
-
#initialize(index:, cells:) ⇒ Row
constructor
A new instance of Row.
- #size ⇒ Object
- #values ⇒ Object
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
#cells ⇒ Object (readonly)
Returns the value of attribute cells.
3 4 5 |
# File 'lib/rbxl/row.rb', line 3 def cells @cells end |
#index ⇒ Object (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 |
#size ⇒ Object
19 20 21 |
# File 'lib/rbxl/row.rb', line 19 def size cells.size end |
#values ⇒ Object
15 16 17 |
# File 'lib/rbxl/row.rb', line 15 def values @values ||= cells.map(&:value).freeze end |