Class: Duty::Tasks::Base::Command
- Inherits:
-
Object
- Object
- Duty::Tasks::Base::Command
- Defined in:
- lib/duty/tasks.rb
Class Method Summary collapse
Instance Method Summary collapse
- #description ⇒ Object
- #error ⇒ Object
-
#initialize(description, callable) ⇒ Command
constructor
A new instance of Command.
- #logger ⇒ Object
- #success? ⇒ Boolean
Constructor Details
#initialize(description, callable) ⇒ Command
Returns a new instance of Command.
102 103 104 105 106 107 108 |
# File 'lib/duty/tasks.rb', line 102 def initialize(description, callable) @description = description @callable = callable @success = false @error = nil @logger = [] end |
Class Method Details
.run(description, callable) ⇒ Object
110 111 112 |
# File 'lib/duty/tasks.rb', line 110 def self.run(description, callable) new(description, callable).tap {|command| command.execute} end |
Instance Method Details
#description ⇒ Object
118 119 120 |
# File 'lib/duty/tasks.rb', line 118 def description @description end |
#error ⇒ Object
126 127 128 |
# File 'lib/duty/tasks.rb', line 126 def error @error end |
#logger ⇒ Object
122 123 124 |
# File 'lib/duty/tasks.rb', line 122 def logger @logger end |
#success? ⇒ Boolean
114 115 116 |
# File 'lib/duty/tasks.rb', line 114 def success? @success end |