Class: RgGen::RegisterMap::GenericMap::Sheet

Inherits:
Object
  • Object
show all
Defined in:
lib/rggen/core_components/register_map/generic_map.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#nameObject (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

#rowsObject (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