Class: RgGen::RegisterMap::GenericMap::Sheet
- Inherits:
-
Object
- Object
- RgGen::RegisterMap::GenericMap::Sheet
- Defined in:
- lib/rggen/core_components/register_map/generic_map.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#rows ⇒ Object
readonly
Returns the value of attribute rows.
Instance Method Summary collapse
- #[](row, column) ⇒ Object
- #[]=(row, column, value) ⇒ Object
-
#initialize(file, name) ⇒ Sheet
constructor
A new instance of Sheet.
Constructor Details
#initialize(file, name) ⇒ Sheet
Returns a new instance of Sheet.
20 21 22 23 24 |
# File 'lib/rggen/core_components/register_map/generic_map.rb', line 20 def initialize(file, name) @file = file @name = name @rows = [] end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
26 27 28 |
# File 'lib/rggen/core_components/register_map/generic_map.rb', line 26 def name @name end |
#rows ⇒ Object (readonly)
Returns the value of attribute rows.
27 28 29 |
# File 'lib/rggen/core_components/register_map/generic_map.rb', line 27 def rows @rows end |
Instance Method Details
#[](row, column) ⇒ Object
29 30 31 32 |
# File 'lib/rggen/core_components/register_map/generic_map.rb', line 29 def [](row, column) rows[row] ||= [] rows[row][column] ||= Cell.new(@file, name, row, column) end |
#[]=(row, column, value) ⇒ Object
34 35 36 |
# File 'lib/rggen/core_components/register_map/generic_map.rb', line 34 def []=(row, column, value) self[row, column].value = value end |