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.
31 32 33 34 35 |
# File 'lib/rggen/core_components/register_map/generic_map.rb', line 31 def initialize(file, name) @file = file @name = name @rows = [] end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
37 38 39 |
# File 'lib/rggen/core_components/register_map/generic_map.rb', line 37 def name @name end |
#rows ⇒ Object (readonly)
Returns the value of attribute rows.
38 39 40 |
# File 'lib/rggen/core_components/register_map/generic_map.rb', line 38 def rows @rows end |
Instance Method Details
#[](row, column) ⇒ Object
40 41 42 43 |
# File 'lib/rggen/core_components/register_map/generic_map.rb', line 40 def [](row, column) rows[row] ||= [] rows[row][column] ||= Cell.new(@file, name, row, column) end |
#[]=(row, column, value) ⇒ Object
45 46 47 |
# File 'lib/rggen/core_components/register_map/generic_map.rb', line 45 def []=(row, column, value) self[row, column].value = value end |