Sha256: 5ecb858d8ff416e77ed23932db81db2200d5d83b0b721207f04977430cd940e2

Contents?: true

Size: 936 Bytes

Versions: 20

Compression:

Stored size: 936 Bytes

Contents

# frozen_string_literal: true
module Puppet::Pops
module Types
  class RubyMethod < Annotation
    # Register the Annotation type. This is the type that all custom Annotations will inherit from.
    def self.register_ptype(loader, ir)
      @type = Pcore::create_object_type(loader, ir, self, 'RubyMethod', 'Annotation',
        'body' => PStringType::DEFAULT,
        'parameters' => {
          KEY_TYPE => POptionalType.new(PStringType::NON_EMPTY),
          KEY_VALUE => nil
        }
      )
    end

    def self.from_hash(init_hash)
      from_asserted_hash(Types::TypeAsserter.assert_instance_of('RubyMethod initializer', _pcore_type.init_hash_type, init_hash))
    end

    def self.from_asserted_hash(init_hash)
      new(init_hash['body'], init_hash['parameters'])
    end

    attr_reader :body, :parameters

    def initialize(body, parameters = nil)
      @body = body
      @parameters = parameters
    end
  end
end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
puppet-8.3.0 lib/puppet/pops/types/ruby_method.rb
puppet-8.3.0-x86-mingw32 lib/puppet/pops/types/ruby_method.rb
puppet-8.3.0-x64-mingw32 lib/puppet/pops/types/ruby_method.rb
puppet-8.3.0-universal-darwin lib/puppet/pops/types/ruby_method.rb
puppet-8.3.1 lib/puppet/pops/types/ruby_method.rb
puppet-8.3.1-x86-mingw32 lib/puppet/pops/types/ruby_method.rb
puppet-8.3.1-x64-mingw32 lib/puppet/pops/types/ruby_method.rb
puppet-8.3.1-universal-darwin lib/puppet/pops/types/ruby_method.rb
puppet-8.2.0 lib/puppet/pops/types/ruby_method.rb
puppet-8.2.0-x86-mingw32 lib/puppet/pops/types/ruby_method.rb
puppet-8.2.0-x64-mingw32 lib/puppet/pops/types/ruby_method.rb
puppet-8.2.0-universal-darwin lib/puppet/pops/types/ruby_method.rb
puppet-8.1.0 lib/puppet/pops/types/ruby_method.rb
puppet-8.1.0-x86-mingw32 lib/puppet/pops/types/ruby_method.rb
puppet-8.1.0-x64-mingw32 lib/puppet/pops/types/ruby_method.rb
puppet-8.1.0-universal-darwin lib/puppet/pops/types/ruby_method.rb
puppet-8.0.1 lib/puppet/pops/types/ruby_method.rb
puppet-8.0.1-x86-mingw32 lib/puppet/pops/types/ruby_method.rb
puppet-8.0.1-x64-mingw32 lib/puppet/pops/types/ruby_method.rb
puppet-8.0.1-universal-darwin lib/puppet/pops/types/ruby_method.rb