Class: FlowClient::EventsResult

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

#initializeEventsResult

Returns a new instance of EventsResult.



10
11
12
13
14
15
# File 'lib/flow_client/event.rb', line 10

def initialize
  @block_id = nil
  @block_height = nil
  @events = nil
  @block_timestamp = nil
end

Instance Attribute Details

#block_heightObject

Returns the value of attribute block_height.



5
6
7
# File 'lib/flow_client/event.rb', line 5

def block_height
  @block_height
end

#block_idObject

Returns the value of attribute block_id.



5
6
7
# File 'lib/flow_client/event.rb', line 5

def block_id
  @block_id
end

#block_timestampObject

Returns the value of attribute block_timestamp.



5
6
7
# File 'lib/flow_client/event.rb', line 5

def block_timestamp
  @block_timestamp
end

#eventsObject

Returns the value of attribute events.



5
6
7
# File 'lib/flow_client/event.rb', line 5

def events
  @events
end

Class Method Details

.parse_grpc_type(type) ⇒ Object



17
18
19
20
21
22
23
24
# File 'lib/flow_client/event.rb', line 17

def self.parse_grpc_type(type)
  event = EventsResult.new
  event.block_id = type.block_id.unpack1("H*")
  event.block_height = type.block_height
  event.block_timestamp = FlowClient::Utils.parse_protobuf_timestamp(type.block_timestamp)
  event.events = type.events.map { |event| FlowClient::Event.parse_grpc_type(event) }
  event
end