Class: Larynx::Command

Inherits:
Object
  • Object
show all
Includes:
Callbacks
Defined in:
lib/larynx/command.rb

Direct Known Subclasses

ApiCommand, AppCommand, CallCommand

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Callbacks

included

Constructor Details

#initialize(command, params = nil, &block) ⇒ Command

Returns a new instance of Command.



9
10
11
12
# File 'lib/larynx/command.rb', line 9

def initialize(command, params=nil, &block)
  @command, @params, @callbacks = command, params, {}
  after(&block) if block_given?
end

Instance Attribute Details

#commandObject (readonly)

Returns the value of attribute command.



4
5
6
# File 'lib/larynx/command.rb', line 4

def command
  @command
end

#interruptedObject

Returns the value of attribute interrupted.



5
6
7
# File 'lib/larynx/command.rb', line 5

def interrupted
  @interrupted
end

Instance Method Details

#finalizeObject



34
35
36
# File 'lib/larynx/command.rb', line 34

def finalize
  fire_callback :after
end

#interruptable?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/larynx/command.rb', line 22

def interruptable?
  false
end

#interrupted?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/larynx/command.rb', line 26

def interrupted?
  @interrupted
end

#nameObject



18
19
20
# File 'lib/larynx/command.rb', line 18

def name
  @command
end

#setupObject



30
31
32
# File 'lib/larynx/command.rb', line 30

def setup
  fire_callback :before
end

#to_sObject



14
15
16
# File 'lib/larynx/command.rb', line 14

def to_s
  @command
end