Method: Retrospec::Puppet::Generators::FunctionGenerator#initialize

Defined in:
lib/retrospec/plugins/v1/plugin/generators/function_generator.rb

#initialize(module_path, spec_object = {}) ⇒ FunctionGenerator

retrospec will initilalize this class so its up to you to set any additional variables you need to get the job done.



10
11
12
13
14
15
16
17
18
# File 'lib/retrospec/plugins/v1/plugin/generators/function_generator.rb', line 10

def initialize(module_path, spec_object = {})
  super
  # below is the Spec Object which serves as a context for template rendering
  # you will need to initialize this object, so the erb templates can get the binding
  # the SpecObject can be customized to your liking as its different for every plugin gem.
  @context = OpenStruct.new({ :name => spec_object[:name], :return_type => spec_object[:return_type],
                            :function_type => spec_object[:type],
                            :test_type => spec_object[:test_type] }.merge(spec_object))
end