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.



15
16
17
18
19
# File 'lib/cem_acpt/actions.rb', line 15

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.



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

def name
  @name
end

#orderObject (readonly)

Returns the value of attribute order.



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

def order
  @order
end

Instance Method Details

#call(context) ⇒ Object



21
22
23
# File 'lib/cem_acpt/actions.rb', line 21

def call(context)
  @block&.call(context)
end