Class: Eve::Registry

Inherits:
Object
  • Object
show all
Defined in:
lib/eve/registry.rb

Direct Known Subclasses

BaseRegistry, EmptyRegistry

Class Method Summary collapse

Class Method Details

.handle(app, cmd, display_messages) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/eve/registry.rb', line 10

def self.handle(app,cmd,display_messages)
  result = app.default_result
  action, data = action_and_input(cmd)
  inner_action, inner_data = action_and_input(data)
  if available[action].include?(inner_action)
    result = send(Application.methodize("call_#{action}_#{inner_action}"), app, result, inner_data, display_messages)  
  else
    result = send(Application.methodize("call_#{action}"), app, result, data, display_messages)  
  end
  result
end

.handle?(cmd) ⇒ Boolean

Returns:

  • (Boolean)


5
6
7
8
# File 'lib/eve/registry.rb', line 5

def self.handle?(cmd)
  action, data = action_and_input(cmd)
  available.include?(action)
end