Class: RServiceBus2::SagaData

Inherits:
Object
  • Object
show all
Defined in:
lib/rservicebus2/saga/data.rb

Overview

Saga Data

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(saga) ⇒ SagaData

Returns a new instance of SagaData.



7
8
9
10
11
12
13
14
# File 'lib/rservicebus2/saga/data.rb', line 7

def initialize(saga)
  @createdat = DateTime.now
  @correlation_id = UUIDTools::UUID.random_create
  @saga_class_name = saga.class.name
  @finished = false

  @hash = {}
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args, &block) ⇒ Object



16
17
18
# File 'lib/rservicebus2/saga/data.rb', line 16

def method_missing(name, *args, &block)
  @hash.send(name, *args, &block)
end

Instance Attribute Details

#correlation_idObject (readonly)

Returns the value of attribute correlation_id.



4
5
6
# File 'lib/rservicebus2/saga/data.rb', line 4

def correlation_id
  @correlation_id
end

#finishedObject

Returns the value of attribute finished.



5
6
7
# File 'lib/rservicebus2/saga/data.rb', line 5

def finished
  @finished
end

#saga_class_nameObject (readonly)

Returns the value of attribute saga_class_name.



4
5
6
# File 'lib/rservicebus2/saga/data.rb', line 4

def saga_class_name
  @saga_class_name
end