class Puppet::DataTypes::TypeBuilderAPI

The TypeBuilderAPI class exposes only those methods that the builder API provides @api public

Public Class Methods

new(type_builder) click to toggle source

@api private

    # File lib/puppet/datatypes.rb
190 def initialize(type_builder)
191   @type_builder = type_builder
192 end

Public Instance Methods

implementation(&block) click to toggle source
    # File lib/puppet/datatypes.rb
199 def implementation(&block)
200   raise ArgumentError, _('a data type can only have one implementation') if @type_builder.has_implementation?
201   @type_builder.implementation = block
202 end
implementation_class(ruby_class) click to toggle source
    # File lib/puppet/datatypes.rb
204 def implementation_class(ruby_class)
205   raise ArgumentError, _('a data type can only have one implementation') if @type_builder.has_implementation?
206   @type_builder.implementation_class = ruby_class
207 end
interface(type_string) click to toggle source
    # File lib/puppet/datatypes.rb
194 def interface(type_string)
195   raise ArgumentError, _('a data type can only have one interface') unless @type_builder.interface.nil?
196   @type_builder.interface = type_string
197 end
load_file(file_name) click to toggle source
    # File lib/puppet/datatypes.rb
209 def load_file(file_name)
210   Puppet::Util::Autoload.load_file(file_name, Puppet.lookup(:current_environment))
211 end