--- !ruby/object:RI::MethodDescription 
aliases: []

block_params: 
comment: 
- !ruby/struct:SM::Flow::P 
  body: Adds an invocation of another generator to this generator. This allows the interface to invoke any templates in that target generator. This requires that the generator is part of a manifold. The name provided is the name of the target generator in this generator's manifold.
- !ruby/struct:SM::Flow::P 
  body: A hash of options can be passed, all of these options are matched against the options passed to the generator.
- !ruby/struct:SM::Flow::P 
  body: If a block is given, the generator class is passed to the block, and it is expected that the block yields an instance. Otherwise the target generator is instantiated with the same options and arguments as this generator.
- !ruby/struct:SM::Flow::H 
  level: 3
  text: Parameters
- !ruby/object:SM::Flow::LIST 
  contents: 
  - !ruby/struct:SM::Flow::LI 
    label: "name<Symbol>:"
    body: The name in the manifold of the generator that is to be invoked
  - !ruby/struct:SM::Flow::LI 
    label: "options<Hash>:"
    body: A hash of requirements that are matched against the generator options
  - !ruby/struct:SM::Flow::LI 
    label: "&block<Proc>:"
    body: A block to execute when the generator is instantiated
  type: :NOTE
- !ruby/struct:SM::Flow::H 
  level: 4
  text: Examples
- !ruby/struct:SM::Flow::VERB 
  body: "  class MyGenerator &lt; Templater::Generator\n    invoke :other_generator\n  end\n\n  class MyGenerator &lt; Templater::Generator\n    def random\n      rand(100000).to_s\n    end\n\n    # invoke :other_generator with some\n    invoke :other_generator do |generator|\n      generator.new(destination_root, options, random)\n    end\n  end\n\n  class MyGenerator &lt; Templater::Generator\n    option :animal\n    # other_generator will be invoked only if the option 'animal' is set to 'bear'\n    invoke :other_generator, :animal =&gt; :bear\n  end\n"
full_name: Templater::Generator::invoke
is_singleton: true
name: invoke
params: (name, options={}, &block)
visibility: public
