Class: FlowClient::Collection

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCollection

Returns a new instance of Collection.



7
8
9
10
# File 'lib/flow_client/collection.rb', line 7

def initialize
  @id = nil
  @transaction_ids = []
end

Instance Attribute Details

#idObject

Returns the value of attribute id.



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

def id
  @id
end

#transaction_idsObject

Returns the value of attribute transaction_ids.



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

def transaction_ids
  @transaction_ids
end

Class Method Details

.parse_grpc_type(grpc_type) ⇒ Object



12
13
14
15
16
17
# File 'lib/flow_client/collection.rb', line 12

def self.parse_grpc_type(grpc_type)
  collection = Collection.new
  collection.id = grpc_type.collection.id.unpack1("H*")
  collection.transaction_ids = grpc_type.collection.transaction_ids.to_a.map { |tid| tid.unpack1("H*") }
  collection
end