Sha256: 08cc14e49a1331368778bc7e139ecf01829e5754279e82a3efe9900b4ae7101c

Contents?: true

Size: 1.56 KB

Versions: 80

Compression:

Stored size: 1.56 KB

Contents

require 'rgen/metamodel_builder'

# The Bindings model is a model of Key to Producer mappings (bindings).
# It is composed of a meta-model part (bindings_model_meta.rb), and
# and implementation part (this file).
#
# @see Puppet::Pops::Binder::BindingsFactory The BindingsFactory for more details on how to create model instances.
# @api public
module Puppet::Pops::Binder
  require 'puppet/pops/binder/bindings_model_meta'

  # TODO: See PUP-2978 for possible performance optimization

  # Mix in implementation into the generated code
  module Bindings
    class BindingsModelObject
      include Puppet::Pops::Visitable
      include Puppet::Pops::Adaptable
      include Puppet::Pops::Containment
    end

    class ConstantProducerDescriptor
      module ClassModule
        def setValue(v)
          @value = v
        end
        def getValue()
          @value
        end
        def value=(v)
          @value = v
        end
      end
    end

    class NamedArgument
      module ClassModule
        def setValue(v)
          @value = v
        end
        def getValue()
          @value
        end
        def value=(v)
          @value = v
        end
      end
    end

    class InstanceProducerDescriptor
      module ClassModule
        def addArguments(val, index =-1)
          @arguments ||= []
          @arguments.insert(index, val)
        end
        def removeArguments(val)
          raise "unsupported operation"
        end
        def setArguments(values)
          @arguments = []
          values.each {|v| addArguments(v) }
        end
      end
    end

  end

end

Version data entries

80 entries across 80 versions & 2 rubygems

Version Path
puppet-retrospec-0.12.2 vendor/gems/puppet-3.7.3/lib/puppet/pops/binder/bindings_model.rb
puppet-3.8.7 lib/puppet/pops/binder/bindings_model.rb
puppet-3.8.7-x86-mingw32 lib/puppet/pops/binder/bindings_model.rb
puppet-3.8.7-x64-mingw32 lib/puppet/pops/binder/bindings_model.rb
puppet-3.8.6 lib/puppet/pops/binder/bindings_model.rb
puppet-3.8.6-x86-mingw32 lib/puppet/pops/binder/bindings_model.rb
puppet-retrospec-0.12.1 vendor/gems/puppet-3.7.3/lib/puppet/pops/binder/bindings_model.rb
puppet-3.8.6-x64-mingw32 lib/puppet/pops/binder/bindings_model.rb
puppet-retrospec-0.12.0 vendor/gems/puppet-3.7.3/lib/puppet/pops/binder/bindings_model.rb
puppet-4.3.2 lib/puppet/pops/binder/bindings_model.rb
puppet-4.3.2-x86-mingw32 lib/puppet/pops/binder/bindings_model.rb
puppet-4.3.2-x64-mingw32 lib/puppet/pops/binder/bindings_model.rb
puppet-3.8.5 lib/puppet/pops/binder/bindings_model.rb
puppet-3.8.5-x86-mingw32 lib/puppet/pops/binder/bindings_model.rb
puppet-3.8.5-x64-mingw32 lib/puppet/pops/binder/bindings_model.rb
puppet-4.3.1 lib/puppet/pops/binder/bindings_model.rb
puppet-4.3.1-x86-mingw32 lib/puppet/pops/binder/bindings_model.rb
puppet-4.3.1-x64-mingw32 lib/puppet/pops/binder/bindings_model.rb
puppet-4.3.0 lib/puppet/pops/binder/bindings_model.rb
puppet-4.3.0-x86-mingw32 lib/puppet/pops/binder/bindings_model.rb