Module: Subroutine::Outputs::ClassMethods

Defined in:
lib/subroutine/outputs.rb

Instance Method Summary collapse

Instance Method Details

#outputs(*names) ⇒ Object



22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/subroutine/outputs.rb', line 22

def outputs(*names)
  options = names.extract_options!
  names.each do |name|
    config = ::Subroutine::Outputs::Configuration.new(name, options)
    self.output_configurations = output_configurations.merge(name.to_sym => config)

    class_eval <<-EV, __FILE__, __LINE__ + 1
      def #{name}
        get_output(:#{name})
      end
    EV
  end
end