Class: Space::App::Handler

Inherits:
Object
  • Object
show all
Defined in:
lib/space/app/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.



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

def initialize(project)
  @project = project
end

Instance Attribute Details

#projectObject (readonly)

Returns the value of attribute project.



9
10
11
# File 'lib/space/app/handler.rb', line 9

def project
  @project
end

Instance Method Details

#run(line) ⇒ Object



15
16
17
18
19
# File 'lib/space/app/handler.rb', line 15

def run(line)
  scope, type = parse(line)
  command = command_for(scope, type)
  command.run
end