Class: FlowClient::BlockHeader

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

Overview

Represents a block header

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeBlockHeader

Returns a new instance of BlockHeader.



64
65
# File 'lib/flow_client/block.rb', line 64

def initialize
end

Instance Attribute Details

#heightObject

Returns the value of attribute height.



62
63
64
# File 'lib/flow_client/block.rb', line 62

def height
  @height
end

#idObject

Returns the value of attribute id.



62
63
64
# File 'lib/flow_client/block.rb', line 62

def id
  @id
end

#parent_idObject

Returns the value of attribute parent_id.



62
63
64
# File 'lib/flow_client/block.rb', line 62

def parent_id
  @parent_id
end

#timestampObject

Returns the value of attribute timestamp.



62
63
64
# File 'lib/flow_client/block.rb', line 62

def timestamp
  @timestamp
end

Class Method Details

.parse_grpc_type(grpc_type) ⇒ Object



67
68
69
70
71
72
73
# File 'lib/flow_client/block.rb', line 67

def self.parse_grpc_type(grpc_type)
  header = BlockHeader.new
  header.id = grpc_type.id.unpack1("H*")
  header.height = grpc_type.height
  header.timestamp = FlowClient::Utils.parse_protobuf_timestamp(grpc_type.timestamp)
  header
end