Class: Nem::Model::ExpelorerBlock
- Inherits:
-
Object
- Object
- Nem::Model::ExpelorerBlock
- Includes:
- Nem::Mixin::Assignable
- Defined in:
- lib/nem/model/explorer_block.rb
Instance Attribute Summary collapse
-
#block ⇒ Object
readonly
Returns the value of attribute block.
-
#difficulty ⇒ Object
readonly
Returns the value of attribute difficulty.
-
#hash ⇒ Object
readonly
Returns the value of attribute hash.
-
#txes ⇒ Object
readonly
Returns the value of attribute txes.
Class Method Summary collapse
Methods included from Nem::Mixin::Assignable
Instance Attribute Details
#block ⇒ Object (readonly)
Returns the value of attribute block.
6 7 8 |
# File 'lib/nem/model/explorer_block.rb', line 6 def block @block end |
#difficulty ⇒ Object (readonly)
Returns the value of attribute difficulty.
6 7 8 |
# File 'lib/nem/model/explorer_block.rb', line 6 def difficulty @difficulty end |
#hash ⇒ Object (readonly)
Returns the value of attribute hash.
6 7 8 |
# File 'lib/nem/model/explorer_block.rb', line 6 def hash @hash end |
#txes ⇒ Object (readonly)
Returns the value of attribute txes.
6 7 8 |
# File 'lib/nem/model/explorer_block.rb', line 6 def txes @txes end |
Class Method Details
.new_from_explorer_block(hash) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/nem/model/explorer_block.rb', line 8 def self.new_from_explorer_block(hash) txes = hash[:txes].map do |tx| Transaction.( meta: { hash: { data: tx[:hash] } }, transaction: tx[:tx] ) end new( difficulty: hash[:difficulty], txes: txes, block: Block.new_from_block(hash[:block]), hash: hash[:hash] ) end |