Class: FoundationKit::Command
- Defined in:
- lib/foundation_kit/command.rb
Overview
Implements an abstract class for the command design pattern.
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#execution_order ⇒ Object
readonly
Returns the value of attribute execution_order.
-
#result ⇒ Object
readonly
Returns the value of attribute result.
Instance Method Summary collapse
-
#initialize(description: nil, execution_order: nil, **args) ⇒ FoundationKit::Command
constructor
Creates an instance of the Command class.
-
#success? ⇒ Boolean
Successful execution checker.
Methods inherited from BaseClass
Constructor Details
#initialize(description: nil, execution_order: nil, **args) ⇒ FoundationKit::Command
Creates an instance of the Command class
. if it is part of a composite command exection plan and order matters. . post initialization hooks.
24 25 26 27 28 29 30 |
# File 'lib/foundation_kit/command.rb', line 24 def initialize(description: nil, execution_order: nil, **args) @description = description @execution_order = execution_order @success = false super(description: description, execution_order: execution_order, **args) end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
10 11 12 |
# File 'lib/foundation_kit/command.rb', line 10 def description @description end |
#execution_order ⇒ Object (readonly)
Returns the value of attribute execution_order.
11 12 13 |
# File 'lib/foundation_kit/command.rb', line 11 def execution_order @execution_order end |
#result ⇒ Object (readonly)
Returns the value of attribute result.
12 13 14 |
# File 'lib/foundation_kit/command.rb', line 12 def result @result end |
Instance Method Details
#success? ⇒ Boolean
Successful execution checker
43 44 45 |
# File 'lib/foundation_kit/command.rb', line 43 def success? @success || false end |