Class: Geera::Commands::Start

Inherits:
Command
  • Object
show all
Defined in:
lib/geera/commands/start.rb

Instance Attribute Summary

Attributes inherited from Command

#argv, #config, #geera, #number

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Command

#initialize, #ticket

Constructor Details

This class inherits a constructor from Geera::Commands::Command

Class Method Details

.handle?(command) ⇒ Boolean

Returns:

  • (Boolean)


4
5
6
# File 'lib/geera/commands/start.rb', line 4

def self.handle? command
  'start' == command
end

Instance Method Details

#execute!Object



8
9
10
11
12
13
14
# File 'lib/geera/commands/start.rb', line 8

def execute!
  unless ticket.startable?
    abort "Ticket #{@number} is not startable. Available actions:\n" \
      "  - #{ticket.available_actions.map { |x| x.name + "\n" }.join("  - ")}"
  end
  ticket.start!
end