Class: Casper::Entity::Block
- Inherits:
-
Object
- Object
- Casper::Entity::Block
- Defined in:
- lib/entity/block.rb
Overview
Block
Instance Method Summary collapse
-
#get_body ⇒ BlockBody
Block body.
-
#get_hash ⇒ String
Block hash.
-
#get_header ⇒ BlockHeader
Block header.
-
#get_proofs ⇒ Array<BlockProof>
List of proofs for this block.
-
#initialize(hash, header = {}, body = {}, proofs = []) ⇒ Block
constructor
A new instance of Block.
Constructor Details
#initialize(hash, header = {}, body = {}, proofs = []) ⇒ Block
Returns a new instance of Block.
10 11 12 13 14 15 16 |
# File 'lib/entity/block.rb', line 10 def initialize(hash, header = {}, body = {}, proofs = []) @hash = hash @header = Casper::Entity::BlockHeader.new(header) @body = Casper::Entity::BlockBody.new(body) @proofs = [] proofs.each { |proof| @proofs << Casper::Entity::BlockProof.new(proof) } end |
Instance Method Details
#get_body ⇒ BlockBody
Returns block body.
29 30 31 |
# File 'lib/entity/block.rb', line 29 def get_body @body end |
#get_hash ⇒ String
Returns block hash.
19 20 21 |
# File 'lib/entity/block.rb', line 19 def get_hash @hash end |
#get_header ⇒ BlockHeader
Returns block header.
24 25 26 |
# File 'lib/entity/block.rb', line 24 def get_header @header end |
#get_proofs ⇒ Array<BlockProof>
Returns list of proofs for this block.
34 35 36 |
# File 'lib/entity/block.rb', line 34 def get_proofs @proofs end |