Class: Rung::Definition::Callback

Inherits:
Object
  • Object
show all
Includes:
ValueObject
Defined in:
lib/rung/definition/callback.rb

Overview

Callback definition Value object.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ValueObject

#==

Constructor Details

#initialize(action, from_block: false) ⇒ Callback

Returns a new instance of Callback.

Parameters:

  • action (#call, Symbol)
  • from_block (Boolean) (defaults to: false)

    true when callback is defined using a Ruby block


9
10
11
12
# File 'lib/rung/definition/callback.rb', line 9

def initialize(action, from_block: false)
  @action = action
  @from_block = from_block
end

Instance Attribute Details

#action#call (readonly)

Returns:

  • (#call)

15
16
17
# File 'lib/rung/definition/callback.rb', line 15

def action
  @action
end

#from_blockBoolean (readonly)

Returns:

  • (Boolean)

17
18
19
# File 'lib/rung/definition/callback.rb', line 17

def from_block
  @from_block
end