Class: CemAcpt::Actions::Action
- Inherits:
-
Object
- Object
- CemAcpt::Actions::Action
- Defined in:
- lib/cem_acpt/actions.rb
Overview
Represents an action to be executed.
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#order ⇒ Object
readonly
Returns the value of attribute order.
Instance Method Summary collapse
- #call(context) ⇒ Object
-
#initialize(name, order: 0, &block) ⇒ Action
constructor
A new instance of Action.
Constructor Details
#initialize(name, order: 0, &block) ⇒ Action
Returns a new instance of Action.
16 17 18 19 20 |
# File 'lib/cem_acpt/actions.rb', line 16 def initialize(name, order: 0, &block) @name = name.to_sym @order = order @block = block end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
14 15 16 |
# File 'lib/cem_acpt/actions.rb', line 14 def name @name end |
#order ⇒ Object (readonly)
Returns the value of attribute order.
14 15 16 |
# File 'lib/cem_acpt/actions.rb', line 14 def order @order end |
Instance Method Details
#call(context) ⇒ Object
22 23 24 |
# File 'lib/cem_acpt/actions.rb', line 22 def call(context) @block&.call(context) end |