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.



71
# File 'lib/flow_client/block.rb', line 71

def initialize; end

Instance Attribute Details

#heightObject

Returns the value of attribute height.



69
70
71
# File 'lib/flow_client/block.rb', line 69

def height
  @height
end

#idObject

Returns the value of attribute id.



69
70
71
# File 'lib/flow_client/block.rb', line 69

def id
  @id
end

#parent_idObject

Returns the value of attribute parent_id.



69
70
71
# File 'lib/flow_client/block.rb', line 69

def parent_id
  @parent_id
end

#timestampObject

Returns the value of attribute timestamp.



69
70
71
# File 'lib/flow_client/block.rb', line 69

def timestamp
  @timestamp
end

Class Method Details

.parse_grpc_type(grpc_type) ⇒ Object



73
74
75
76
77
78
79
# File 'lib/flow_client/block.rb', line 73

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