Sha256: aed66f00b7b65a13c99b1570ac76ffe80053304cb756e2091229e0d72ceded49

Contents?: true

Size: 1.29 KB

Versions: 85

Compression:

Stored size: 1.29 KB

Contents

module Origen
  # API for dealing with instantiating and keeping track of components or
  # 'component-like object' (e.g. sub blocks).
  # This API can be included as a mixin and extended further extended by the includer
  # to get the top-level component behavior while providing more refined usage at the same time.
  module Component
    # Componentable Component class. This is the general purpose container to just 'add a thing'
    class Component
      include Origen::Componentable

      COMPONENTABLE_ADDS_ACCESSORS = true

      # Kind of ironic really, but since we're auto-including this when Origen::Model is included,
      # we can't include Origen::Model here or else we'll get a circular dependency.
      # Note that the parent will still initialize correctly, but we need to initialize Components manually.
      # I.e, the parent will get methods :component, :add_components, :components, etc., but the Component object
      # won't be initialized so everything will fail.
      def initialize
        Origen::Componentable.init_includer_class(self)
      end
    end

    # Default class instantiate if the class_name is not provided
    class Default
      include Origen::Model

      attr_reader :options

      def initialize(options = {})
        @options = options
      end
    end
  end
end

Version data entries

85 entries across 85 versions & 1 rubygems

Version Path
origen-0.60.18 lib/origen/components.rb
origen-0.60.17 lib/origen/components.rb
origen-0.60.16 lib/origen/components.rb
origen-0.60.14 lib/origen/components.rb
origen-0.60.13 lib/origen/components.rb
origen-0.60.12 lib/origen/components.rb
origen-0.60.11 lib/origen/components.rb
origen-0.60.10 lib/origen/components.rb
origen-0.60.9 lib/origen/components.rb
origen-0.60.8 lib/origen/components.rb
origen-0.60.7 lib/origen/components.rb
origen-0.60.6 lib/origen/components.rb
origen-0.60.5 lib/origen/components.rb
origen-0.60.4 lib/origen/components.rb
origen-0.60.3 lib/origen/components.rb
origen-0.60.2 lib/origen/components.rb
origen-0.60.1 lib/origen/components.rb
origen-0.60.0 lib/origen/components.rb
origen-0.59.8 lib/origen/components.rb
origen-0.59.7 lib/origen/components.rb