Class: Block
- Inherits:
-
Object
- Object
- Block
- Defined in:
- lib/universum/universum.rb
Instance Attribute Summary collapse
-
#number ⇒ Object
readonly
Returns the value of attribute number.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
Instance Method Summary collapse
-
#initialize(timestamp: Timestamp.now, number: 0) ⇒ Block
constructor
A new instance of Block.
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 = # unix epoch time (in seconds since 1970) @number = number # block height (start with 0 - genesis block) end |
Instance Attribute Details
#number ⇒ Object (readonly)
Returns the value of attribute number.
18 19 20 |
# File 'lib/universum/universum.rb', line 18 def number @number end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
18 19 20 |
# File 'lib/universum/universum.rb', line 18 def @timestamp end |