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 191 def initialize(type_builder) 192 @type_builder = type_builder 193 end
Public Instance Methods
implementation(&block)
click to toggle source
# File lib/puppet/datatypes.rb 200 def implementation(&block) 201 raise ArgumentError, _('a data type can only have one implementation') if @type_builder.has_implementation? 202 @type_builder.implementation = block 203 end
implementation_class(ruby_class)
click to toggle source
# File lib/puppet/datatypes.rb 205 def implementation_class(ruby_class) 206 raise ArgumentError, _('a data type can only have one implementation') if @type_builder.has_implementation? 207 @type_builder.implementation_class = ruby_class 208 end
interface(type_string)
click to toggle source
# File lib/puppet/datatypes.rb 195 def interface(type_string) 196 raise ArgumentError, _('a data type can only have one interface') unless @type_builder.interface.nil? 197 @type_builder.interface = type_string 198 end
load_file(file_name)
click to toggle source
# File lib/puppet/datatypes.rb 210 def load_file(file_name) 211 Puppet::Util::Autoload.load_file(file_name, Puppet.lookup(:current_environment)) 212 end