Class: Block

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(timestamp: Timestamp.now, number: 0) ⇒ Block

Returns a new instance of Block.



20
21
22
23
# File 'lib/universum/universum.rb', line 20

def initialize( timestamp: Timestamp.now, number: 0 )
  @timestamp = timestamp   # unix epoch time (in seconds since 1970)
  @number    = number      # block height (start with 0 - genesis block)
end

Instance Attribute Details

#numberObject (readonly)

Returns the value of attribute number.



18
19
20
# File 'lib/universum/universum.rb', line 18

def number
  @number
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



18
19
20
# File 'lib/universum/universum.rb', line 18

def timestamp
  @timestamp
end