class Transaction

Attributes

amount[R]
from[R]
id[R]
to[R]

Public Class Methods

from_h( hash ) click to toggle source
# File lib/shilling/transaction.rb, line 14
def self.from_h( hash )
  self.new *hash.values_at( 'from', 'to', 'amount', 'id' )
end
new( from, to, amount, id=SecureRandom.uuid ) click to toggle source
# File lib/shilling/transaction.rb, line 7
def initialize( from, to, amount, id=SecureRandom.uuid )
  @from   = from
  @to     = to
  @amount = amount
  @id     = id
end

Public Instance Methods

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