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.



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

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

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