Class: FlowClient::Event

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_client/event.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeEvent

Returns a new instance of Event.



34
35
36
37
38
39
40
# File 'lib/flow_client/event.rb', line 34

def initialize
  @type = nil
  @transaction_id = nil
  @transaction_index = nil
  @event_index = nil
  @payload = nil
end

Instance Attribute Details

#event_indexObject

Returns the value of attribute event_index.



28
29
30
# File 'lib/flow_client/event.rb', line 28

def event_index
  @event_index
end

#payloadObject

Returns the value of attribute payload.



28
29
30
# File 'lib/flow_client/event.rb', line 28

def payload
  @payload
end

#transaction_idObject

Returns the value of attribute transaction_id.



28
29
30
# File 'lib/flow_client/event.rb', line 28

def transaction_id
  @transaction_id
end

#transaction_indexObject

Returns the value of attribute transaction_index.



28
29
30
# File 'lib/flow_client/event.rb', line 28

def transaction_index
  @transaction_index
end

#typeObject

Returns the value of attribute type.



28
29
30
# File 'lib/flow_client/event.rb', line 28

def type
  @type
end

Class Method Details

.parse_grpc_type(type) ⇒ Object



42
43
44
45
46
47
48
49
50
# File 'lib/flow_client/event.rb', line 42

def self.parse_grpc_type(type)
  event = Event.new
  event.type = type.type
  event.transaction_id = type.transaction_id.unpack1("H*")
  event.transaction_index = type.transaction_index
  event.event_index = type.event_index
  event.payload = type.payload
  event
end