Class: Puppet::DataTypes::TypeBuilderAPI
- Defined in:
- lib/puppet/datatypes.rb
Overview
The TypeBuilderAPI class exposes only those methods that the builder API provides
Instance Method Summary collapse
- #implementation(&block) ⇒ Object
- #implementation_class(ruby_class) ⇒ Object
-
#initialize(type_builder) ⇒ TypeBuilderAPI
constructor
private
A new instance of TypeBuilderAPI.
- #interface(type_string) ⇒ Object
- #load_file(file_name) ⇒ Object
Constructor Details
#initialize(type_builder) ⇒ TypeBuilderAPI
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of TypeBuilderAPI.
192 193 194 |
# File 'lib/puppet/datatypes.rb', line 192 def initialize(type_builder) @type_builder = type_builder end |
Instance Method Details
#implementation(&block) ⇒ Object
202 203 204 205 206 |
# File 'lib/puppet/datatypes.rb', line 202 def implementation(&block) raise ArgumentError, _('a data type can only have one implementation') if @type_builder.has_implementation? @type_builder.implementation = block end |
#implementation_class(ruby_class) ⇒ Object
208 209 210 211 212 |
# File 'lib/puppet/datatypes.rb', line 208 def implementation_class(ruby_class) raise ArgumentError, _('a data type can only have one implementation') if @type_builder.has_implementation? @type_builder.implementation_class = ruby_class end |