Method: PDK::Generate::PuppetObject#initialize
- Defined in:
- lib/pdk/generate/puppet_object.rb
#initialize(context, object_name, options) ⇒ PuppetObject
Initialises the PDK::Generate::PuppetObject object.
In general, this object should never be instantiated directly. Instead, one of the subclasses should be used e.g. PDK::Generate::Klass.
New subclasses generally only need to inherit this class, set the OBJECT_TYPE constant and implement the #template_data, #target_object_path and #target_spec_path methods.
23 24 25 26 27 28 |
# File 'lib/pdk/generate/puppet_object.rb', line 23 def initialize(context, object_name, ) raise ArgumentError, _('Expected PDK::Context::AbstractContext but got \'%{klass}\' for context') % { klass: context.class } unless context.is_a?(PDK::Context::AbstractContext) @context = context = @object_name = object_name end |