Sha256: 2ff1a197b988237e071faa430123ebc1238ddd2e79b7f0473be4d0309cdc3fa0

Contents?: true

Size: 789 Bytes

Versions: 203

Compression:

Stored size: 789 Bytes

Contents

# frozen_string_literal: true

require 'avm/application_stereotypes/base'
require 'eac_ruby_utils/core_ext'

module Avm
  module Registry
    class ApplicationStereotypes
      class StereotypeBuilder
        common_constructor :namespace_module

        def add_object(type, object)
          type = type.to_sym
          raise "#{attr_method} is already present" if resources.key?(type)

          resources[::Avm::ApplicationStereotypes::Base.lists.resource.value_validate!(type)] =
            object
        end

        # @return [Avm::ApplicationStereotypes::Base]
        def build
          ::Avm::ApplicationStereotypes::Base.new(namespace_module, resources)
        end

        private

        def resources
          @resources ||= {}
        end
      end
    end
  end
end

Version data entries

203 entries across 203 versions & 2 rubygems

Version Path
eac_tools-0.79.0 sub/avm/lib/avm/registry/application_stereotypes/stereotype_builder.rb
avm-0.80.0 lib/avm/registry/application_stereotypes/stereotype_builder.rb
eac_tools-0.78.0 sub/avm/lib/avm/registry/application_stereotypes/stereotype_builder.rb
eac_tools-0.77.1 sub/avm/lib/avm/registry/application_stereotypes/stereotype_builder.rb
eac_tools-0.77.0 sub/avm/lib/avm/registry/application_stereotypes/stereotype_builder.rb
eac_tools-0.76.1 sub/avm/lib/avm/registry/application_stereotypes/stereotype_builder.rb
eac_tools-0.76.0 sub/avm/lib/avm/registry/application_stereotypes/stereotype_builder.rb
eac_tools-0.75.2 sub/avm/lib/avm/registry/application_stereotypes/stereotype_builder.rb
eac_tools-0.75.1 sub/avm/lib/avm/registry/application_stereotypes/stereotype_builder.rb
eac_tools-0.75.0 sub/avm/lib/avm/registry/application_stereotypes/stereotype_builder.rb
eac_tools-0.74.1 sub/avm/lib/avm/registry/application_stereotypes/stereotype_builder.rb
eac_tools-0.74.0 sub/avm/lib/avm/registry/application_stereotypes/stereotype_builder.rb
avm-0.79.0 lib/avm/registry/application_stereotypes/stereotype_builder.rb
eac_tools-0.73.0 sub/avm/lib/avm/registry/application_stereotypes/stereotype_builder.rb
eac_tools-0.72.0 sub/avm/lib/avm/registry/application_stereotypes/stereotype_builder.rb
avm-0.78.0 lib/avm/registry/application_stereotypes/stereotype_builder.rb
eac_tools-0.70.1 sub/avm/lib/avm/registry/application_stereotypes/stereotype_builder.rb
avm-0.77.0 lib/avm/registry/application_stereotypes/stereotype_builder.rb
eac_tools-0.70.0 sub/avm/lib/avm/registry/application_stereotypes/stereotype_builder.rb
avm-0.76.0 lib/avm/registry/application_stereotypes/stereotype_builder.rb