Class: CemAcpt::Actions::Action

Inherits:
Object
  • Object
show all
Defined in:
lib/cem_acpt/actions.rb

Overview

Represents an action to be executed.

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#nameObject (readonly)

Returns the value of attribute name.



14
15
16
# File 'lib/cem_acpt/actions.rb', line 14

def name
  @name
end

#orderObject (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