Class: Casper::Entity::Block

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

Overview

Block

Instance Method Summary collapse

Constructor Details

#initialize(hash, header = {}, body = {}, proofs = []) ⇒ 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_bodyBlockBody



29
30
31
# File 'lib/entity/block.rb', line 29

def get_body
  @body
end

#get_hashString



19
20
21
# File 'lib/entity/block.rb', line 19

def get_hash
  @hash
end

#get_headerBlockHeader



24
25
26
# File 'lib/entity/block.rb', line 24

def get_header
  @header
end

#get_proofsArray<BlockProof>



34
35
36
# File 'lib/entity/block.rb', line 34

def get_proofs
  @proofs
end