Class: Larynx::Command
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
#command ⇒ Object
Returns the value of attribute command.
4
5
6
|
# File 'lib/larynx/command.rb', line 4
def command
@command
end
|
#interrupted ⇒ Object
Returns the value of attribute interrupted.
5
6
7
|
# File 'lib/larynx/command.rb', line 5
def interrupted
@interrupted
end
|
Instance Method Details
#finalize ⇒ Object
34
35
36
|
# File 'lib/larynx/command.rb', line 34
def finalize
fire_callback :after
end
|
#interruptable? ⇒ Boolean
22
23
24
|
# File 'lib/larynx/command.rb', line 22
def interruptable?
false
end
|
#interrupted? ⇒ Boolean
26
27
28
|
# File 'lib/larynx/command.rb', line 26
def interrupted?
@interrupted
end
|
#name ⇒ Object
18
19
20
|
# File 'lib/larynx/command.rb', line 18
def name
@command
end
|
#setup ⇒ Object
30
31
32
|
# File 'lib/larynx/command.rb', line 30
def setup
fire_callback :before
end
|
#to_s ⇒ Object
14
15
16
|
# File 'lib/larynx/command.rb', line 14
def to_s
@command
end
|