Class: Servactory::Actions::Action
- Inherits:
-
Object
- Object
- Servactory::Actions::Action
- Defined in:
- lib/servactory/actions/action.rb
Instance Attribute Summary collapse
-
#condition ⇒ Object
readonly
Returns the value of attribute condition.
-
#is_condition_opposite ⇒ Object
readonly
Returns the value of attribute is_condition_opposite.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#position ⇒ Object
readonly
Returns the value of attribute position.
Instance Method Summary collapse
-
#initialize(name, position:, **options) ⇒ Action
constructor
A new instance of Action.
Constructor Details
#initialize(name, position:, **options) ⇒ Action
Returns a new instance of Action.
11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/servactory/actions/action.rb', line 11 def initialize(name, position:, **) @name = name @position = position @is_condition_opposite = false @condition = .fetch(:if, nil) return unless @condition.nil? @condition = .fetch(:unless, nil) @is_condition_opposite = true unless @condition.nil? end |
Instance Attribute Details
#condition ⇒ Object (readonly)
Returns the value of attribute condition.
6 7 8 |
# File 'lib/servactory/actions/action.rb', line 6 def condition @condition end |
#is_condition_opposite ⇒ Object (readonly)
Returns the value of attribute is_condition_opposite.
6 7 8 |
# File 'lib/servactory/actions/action.rb', line 6 def is_condition_opposite @is_condition_opposite end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/servactory/actions/action.rb', line 6 def name @name end |
#position ⇒ Object (readonly)
Returns the value of attribute position.
6 7 8 |
# File 'lib/servactory/actions/action.rb', line 6 def position @position end |