Method: Puppet::Pal::Compiler#type
- Defined in:
- lib/puppet/pal/compiler.rb
#type(type_string) ⇒ Puppet::Pops::Types::PAnyType
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.
Parses a puppet data type given in String format and returns that type, or raises an error. A type is needed in calls to ‘new` to create an instance of the data type, or to perform type checking of values - typically using `type.instance?(obj)` to check if `obj` is an instance of the type.
178 179 180 |
# File 'lib/puppet/pal/compiler.rb', line 178 def type(type_string) Puppet::Pops::Types::TypeParser.singleton.parse(type_string) end |