Sha256: f2ac1a759daf635186f6696caae5e77f3a80672559c0ef0db09bb857c2a0cf02

Contents?: true

Size: 687 Bytes

Versions: 205

Compression:

Stored size: 687 Bytes

Contents

module Origen
  module Registers
    # 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 - http://www.ruby-doc.org/core/classes/Hash.html
    class RegCollection < Hash
      # Returns the object that owns the registers
      attr_reader :owner

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

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

      # Display all regs visually in a console session
      def show
        puts map { |_k, v| v }.inspect
      end
    end
  end
end

Version data entries

205 entries across 205 versions & 1 rubygems

Version Path
origen-0.0.6 lib/origen/registers/reg_collection.rb
origen-0.0.5 lib/origen/registers/reg_collection.rb
origen-0.0.4 lib/origen/registers/reg_collection.rb
origen-0.0.3 lib/origen/registers/reg_collection.rb
origen-0.0.2 lib/origen/registers/reg_collection.rb