Class: Space::Action::Handler

Inherits:
Object
  • Object
show all
Defined in:
lib/space/action/handler.rb

Constant Summary collapse

ALIASES =
{
  ''  => 'scope',
  '-' => 'unscope',
  '!' => 'refresh',
  'r' => 'remote',
  'l' => 'local'
}

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(project) ⇒ Handler

Returns a new instance of Handler.



15
16
17
# File 'lib/space/action/handler.rb', line 15

def initialize(project)
  @project = project
end

Instance Attribute Details

#projectObject (readonly)

Returns the value of attribute project.



13
14
15
# File 'lib/space/action/handler.rb', line 13

def project
  @project
end

Instance Method Details

#run(line) ⇒ Object



19
20
21
22
23
24
25
# File 'lib/space/action/handler.rb', line 19

def run(line)
  scope, type = parse(line)
  action = action_for(scope, type)
  Events.sources.registered do
    action.run
  end
end