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.
107 108 109 110 111 112 113 |
# File 'lib/duty/tasks.rb', line 107 def initialize(description, callable) @description = description @callable = callable @success = false @error = nil @logger = [] end |
Class Method Details
.run(description, callable) ⇒ Object
115 116 117 |
# File 'lib/duty/tasks.rb', line 115 def self.run(description, callable) new(description, callable).tap {|command| command.execute} end |
Instance Method Details
#description ⇒ Object
123 124 125 |
# File 'lib/duty/tasks.rb', line 123 def description @description end |
#error ⇒ Object
131 132 133 |
# File 'lib/duty/tasks.rb', line 131 def error @error end |
#logger ⇒ Object
127 128 129 |
# File 'lib/duty/tasks.rb', line 127 def logger @logger end |
#success? ⇒ Boolean
119 120 121 |
# File 'lib/duty/tasks.rb', line 119 def success? @success end |