Class: Nis::Struct::Block

Inherits:
Object
  • Object
show all
Includes:
Util::Assignable
Defined in:
lib/nis/struct/block.rb

Overview

Instance Attribute Summary collapse

Class Method Summary collapse

Methods included from Util::Assignable

#[], #initialize, #to_hash, #to_json

Instance Attribute Details

#heightInteger

Returns the current value of height.

Returns:

  • (Integer)

    the current value of height



11
12
13
# File 'lib/nis/struct/block.rb', line 11

def height
  @height
end

#prevBlockHashString Also known as: prev_block_hash

Returns the current value of prevBlockHash.

Returns:

  • (String)

    the current value of prevBlockHash



11
12
13
# File 'lib/nis/struct/block.rb', line 11

def prevBlockHash
  @prevBlockHash
end

#signatureString

Returns the current value of signature.

Returns:

  • (String)

    the current value of signature



11
12
13
# File 'lib/nis/struct/block.rb', line 11

def signature
  @signature
end

#signerString

Returns the current value of signer.

Returns:

  • (String)

    the current value of signer



11
12
13
# File 'lib/nis/struct/block.rb', line 11

def signer
  @signer
end

#timeStampInteger Also known as: timestamp

Returns the current value of timeStamp.

Returns:

  • (Integer)

    the current value of timeStamp



11
12
13
# File 'lib/nis/struct/block.rb', line 11

def timeStamp
  @timeStamp
end

#transactionsArray <Nis::Struct::transaction>

Returns the current value of transactions.

Returns:

  • (Array <Nis::Struct::transaction>)

    the current value of transactions



11
12
13
# File 'lib/nis/struct/block.rb', line 11

def transactions
  @transactions
end

#typeInteger

Returns the current value of type.

Returns:

  • (Integer)

    the current value of type



11
12
13
# File 'lib/nis/struct/block.rb', line 11

def type
  @type
end

#versionInteger

Returns the current value of version.

Returns:

  • (Integer)

    the current value of version



11
12
13
# File 'lib/nis/struct/block.rb', line 11

def version
  @version
end

Class Method Details

.build(attrs) ⇒ Object



20
21
22
23
# File 'lib/nis/struct/block.rb', line 20

def self.build(attrs)
  attrs[:transactions] = attrs[:transactions].map { |tx| Transaction.build(tx) }
  new(attrs)
end