module RakeFactory::Arguments

Public Class Methods

new(*args, &configuration_block) click to toggle source
Calls superclass method
# File lib/rake_factory/arguments.rb, line 3
def initialize(*args, &configuration_block)
  arity = self.method(:initialize).super_method.arity
  super(*args.slice(0, arity), &configuration_block)
  process_arguments(args)
end

Public Instance Methods

process_arguments(args) click to toggle source
# File lib/rake_factory/arguments.rb, line 9
def process_arguments(args)
  opts = args.first || {}
  opts.each { |key, value| set_if_parameter(key, value) }
end

Private Instance Methods

set_if_parameter(key, value) click to toggle source
# File lib/rake_factory/arguments.rb, line 16
def set_if_parameter(key, value)
  if self.respond_to?("#{key}=")
    self.send("#{key}=", value)
  end
end