Class: Origen::Registers::RegCollection
- 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
-
#owner ⇒ Object
readonly
Returns the object that owns the registers.
Instance Method Summary collapse
-
#initialize(owner, _options = {}) ⇒ RegCollection
constructor
A new instance of RegCollection.
- #inspect ⇒ Object
-
#show ⇒ Object
Display all regs visually in a console session.
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, = {}) @owner = owner end |
Instance Attribute Details
#owner ⇒ Object (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
#inspect ⇒ Object
14 15 16 |
# File 'lib/origen/registers/reg_collection.rb', line 14 def inspect map { |k, _v| k }.inspect end |
#show ⇒ Object
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 |