Class: XRBP::NodeStore::Rate

Inherits:
Object
  • Object
show all
Defined in:
lib/xrbp/nodestore/protocol/rate.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(rate = nil) ⇒ Rate

Returns a new instance of Rate.



6
7
8
# File 'lib/xrbp/nodestore/protocol/rate.rb', line 6

def initialize(rate=nil)
  @rate = rate
end

Instance Attribute Details

#rateObject (readonly)

Returns the value of attribute rate.



4
5
6
# File 'lib/xrbp/nodestore/protocol/rate.rb', line 4

def rate
  @rate
end

Class Method Details

.parityObject



10
11
12
# File 'lib/xrbp/nodestore/protocol/rate.rb', line 10

def self.parity
  @parity ||= Rate.new(QUALITY_ONE)
end

Instance Method Details

#to_amountObject



14
15
16
17
18
# File 'lib/xrbp/nodestore/protocol/rate.rb', line 14

def to_amount
  STAmount.new :issue    => Issue.no_issue,
               :mantissa => rate,
               :exponent =>   -9
end