Class: Blix::Cli::Operation
- Inherits:
-
Object
- Object
- Blix::Cli::Operation
show all
- Defined in:
- lib/blix/cli/operation.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.describe_all ⇒ Object
19
20
21
|
# File 'lib/blix/cli/operation.rb', line 19
def describe_all
list.each(&:describe)
end
|
.execute_all ⇒ Object
15
16
17
|
# File 'lib/blix/cli/operation.rb', line 15
def execute_all
list.each(&:perform)
end
|
.list ⇒ Object
7
8
9
|
# File 'lib/blix/cli/operation.rb', line 7
def list
@@_list ||= []
end
|
.new(*args) ⇒ Object
25
26
27
28
29
30
|
# File 'lib/blix/cli/operation.rb', line 25
def new(*args)
o = old_new(*args)
self.list << o
o
end
|
.old_new ⇒ Object
23
|
# File 'lib/blix/cli/operation.rb', line 23
alias :old_new :new
|
.reset! ⇒ Object
11
12
13
|
# File 'lib/blix/cli/operation.rb', line 11
def reset!
list.clear
end
|
Instance Method Details
#describe ⇒ Object
38
39
40
|
# File 'lib/blix/cli/operation.rb', line 38
def describe
puts description
end
|
#description ⇒ Object
34
35
36
|
# File 'lib/blix/cli/operation.rb', line 34
def description
''
end
|
42
43
44
45
|
# File 'lib/blix/cli/operation.rb', line 42
def perform
puts description
run
end
|
#run ⇒ Object
47
48
|
# File 'lib/blix/cli/operation.rb', line 47
def run
end
|
#undo ⇒ Object
50
51
|
# File 'lib/blix/cli/operation.rb', line 50
def undo
end
|