Class: Space::Action::Handler

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

Constant Summary collapse

ALIASES =
{
  ''  => 'scope',
  '-' => 'unscope',
  'r' => 'refresh'
}

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(project) ⇒ Handler

Returns a new instance of Handler.



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

def initialize(project)
  @project = project
end

Instance Attribute Details

#projectObject (readonly)

Returns the value of attribute project.



11
12
13
# File 'lib/space/action/handler.rb', line 11

def project
  @project
end

Instance Method Details

#run(line) ⇒ Object



17
18
19
20
21
22
# File 'lib/space/action/handler.rb', line 17

def run(line)
  scope, type = parse(line)
  action = action_for(scope, type)
  action.run
  Events.flush
end