Method: Dao::Conducer#process_arguments

Defined in:
lib/dao/conducer.rb

#process_arguments(*args) ⇒ Object



135
136
137
138
139
140
141
142
143
144
145
146
# File 'lib/dao/conducer.rb', line 135

def process_arguments(*args)
  controllers, args = args.partition{|arg| arg.is_a?(ActionController::Base)}
  actions, args = args.partition{|arg| arg.is_a?(Action)}

  controller = controllers.shift || Dao.current_controller || Dao.mock_controller
  action = actions.shift

  set_controller(controller) if controller
  set_action(action) if action

  args.map{|arg| arg.class == Hash ? Map.for(arg) : arg}
end