Sha256: daa4393641de89eb50abd2a5894568499891a30de24fe71dc91919769d18650c
Contents?: true
Size: 1.06 KB
Versions: 28
Compression:
Stored size: 1.06 KB
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
28 entries across 28 versions & 1 rubygems