Class: Origen::Registers::RegCollection

Inherits:
Hash show all
Defined in:
lib/origen/registers/reg_collection.rb

Overview

This is a regular Ruby hash that is used to store collections of Reg objects, it has additional methods added to allow interaction with the contained registers. All Ruby hash methods are also available - www.ruby-doc.org/core/classes/Hash.html

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Hash

#filter, #ids, #intersect?, #intersections, #longest_key, #longest_value, #recursive_find_by_key, #update_common

Constructor Details

#initialize(owner, _options = {}) ⇒ RegCollection

Returns a new instance of RegCollection


10
11
12
# File 'lib/origen/registers/reg_collection.rb', line 10

def initialize(owner, _options = {})
  @owner = owner
end

Instance Attribute Details

#ownerObject (readonly)

Returns the object that owns the registers


8
9
10
# File 'lib/origen/registers/reg_collection.rb', line 8

def owner
  @owner
end

Instance Method Details

#inspectObject


14
15
16
# File 'lib/origen/registers/reg_collection.rb', line 14

def inspect
  map { |k, _v| k }.inspect
end

#showObject

Display all regs visually in a console session


19
20
21
# File 'lib/origen/registers/reg_collection.rb', line 19

def show
  puts map { |_k, v| v }.inspect
end