class Transaction

Attributes

from[R]
id[R]
qty[R]
to[R]
what[R]

Public Class Methods

from_h( hash ) click to toggle source
# File lib/tulipmania/transaction.rb, line 15
def self.from_h( hash )
  self.new *hash.values_at( 'from', 'to', 'qty', 'what', 'id' )
end
new( from, to, qty, what, id=SecureRandom.uuid ) click to toggle source
# File lib/tulipmania/transaction.rb, line 7
def initialize( from, to, qty, what, id=SecureRandom.uuid )
  @from   = from
  @to     = to
  @qty    = qty
  @what   = what      # tulip name - change to name or title - why? why not?
  @id     = id
end

Public Instance Methods

to_h() click to toggle source
# File lib/tulipmania/transaction.rb, line 19
def to_h
  { from: @from, to: @to, qty: @qty, what: @what, id: @id }
end
valid?() click to toggle source
# File lib/tulipmania/transaction.rb, line 24
def valid?
  ## check signature in the future; for now always true
  true
end