class Lapidar::Block

Attributes

created_at[R]
data[R]
hash[R]
nonce[R]
number[R]

Public Class Methods

new(number:, hash:, nonce:, data: nil, created_at: Time.now.to_f) click to toggle source
# File lib/lapidar/block.rb, line 5
def initialize(number:, hash:, nonce:, data: nil, created_at: Time.now.to_f)
  @number = number
  @hash = hash
  @nonce = nonce
  @data = data
  @created_at = created_at
end

Public Instance Methods

==(other) click to toggle source
# File lib/lapidar/block.rb, line 23
def ==(other)
  to_h == other.to_h
end
to_h() click to toggle source
# File lib/lapidar/block.rb, line 13
def to_h
  {
    number: @number,
    hash: @hash,
    nonce: @nonce,
    data: @data,
    created_at: @created_at,
  }
end