Class: Steem::BlockApi
Overview
BlockApi is used to query values related to the block plugin. It can also be used to access a range of multiple blocks by using JSON-RPC 2.0 batch requests.
Also see: Block API Definitions
Constant Summary collapse
- MAX_RANGE_SIZE =
50
Constants inherited from Api
Instance Attribute Summary
Attributes inherited from Api
Instance Method Summary collapse
-
#get_block_headers(options = {block_range: (0..0)}, &block) ⇒ Object
Uses a batched requst on a range of block headers.
-
#get_blocks(options = {block_range: (0..0)}, &block) ⇒ Object
Uses a batched requst on a range of blocks.
-
#initialize(options = {}) ⇒ BlockApi
constructor
A new instance of BlockApi.
Methods inherited from Api
api_class_name, api_name, api_name=, default_rpc_client_class, #inspect, jsonrpc, jsonrpc=, register
Constructor Details
#initialize(options = {}) ⇒ BlockApi
Returns a new instance of BlockApi.
10 11 12 13 |
# File 'lib/steem/block_api.rb', line 10 def initialize( = {}) self.class.api_name = :block_api super end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Steem::Api
Instance Method Details
#get_block_headers(options = {block_range: (0..0)}, &block) ⇒ Object
Uses a batched requst on a range of block headers.
19 20 21 |
# File 'lib/steem/block_api.rb', line 19 def get_block_headers( = {block_range: (0..0)}, &block) get_block_objects(.merge(object: :block_header), block) end |
#get_blocks(options = {block_range: (0..0)}, &block) ⇒ Object
Uses a batched requst on a range of blocks.
27 28 29 |
# File 'lib/steem/block_api.rb', line 27 def get_blocks( = {block_range: (0..0)}, &block) get_block_objects(.merge(object: :block), block) end |