Class: WhyChain::DispatchStep

Inherits:
Object
  • Object
show all
Defined in:
lib/why_chain/dispatch_step.rb

Overview

Immutable value object for a single dispatch step.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(owner:, source_location:) ⇒ DispatchStep

Returns a new instance of DispatchStep.



8
9
10
11
# File 'lib/why_chain/dispatch_step.rb', line 8

def initialize(owner:, source_location:)
  @owner = owner
  @source_location = source_location
end

Instance Attribute Details

#ownerObject (readonly)

Returns the value of attribute owner.



6
7
8
# File 'lib/why_chain/dispatch_step.rb', line 6

def owner
  @owner
end

#source_locationObject (readonly)

Returns the value of attribute source_location.



6
7
8
# File 'lib/why_chain/dispatch_step.rb', line 6

def source_location
  @source_location
end

Instance Method Details

#to_hObject



13
14
15
16
17
18
# File 'lib/why_chain/dispatch_step.rb', line 13

def to_h
  {
    owner: owner,
    source_location: source_location
  }
end