Module: Rippler::Utils

Included in:
Rippler, Account, Ledger, Line, Money, Offer, Transaction
Defined in:
lib/rippler/utils.rb

Overview

Utility methods to be included

Constant Summary collapse

RIPPLE_TIME_OFFSET =

Time.utc(2000,1,1,0,0,0).to_i

946684800

Instance Method Summary collapse

Instance Method Details

#Account(data) ⇒ Object



15
16
17
# File 'lib/rippler/utils.rb', line 15

def (data)
  Rippler::.new(data)
end

#Money(data) ⇒ Object



11
12
13
# File 'lib/rippler/utils.rb', line 11

def Money(data)
  Rippler::Money.new(data)
end

#Offer(data) ⇒ Object



19
20
21
# File 'lib/rippler/utils.rb', line 19

def Offer(data)
  Rippler::Offer.new(data)
end

#Time(seconds) ⇒ Object



7
8
9
# File 'lib/rippler/utils.rb', line 7

def Time(seconds)
  Time.at(RIPPLE_TIME_OFFSET + seconds.to_i)
end