Class: DynamicsCRM::XML::Money

Inherits:
Object
  • Object
show all
Defined in:
lib/dynamics_crm/xml/money.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value, precision = 2) ⇒ Money

Returns a new instance of Money.



7
8
9
# File 'lib/dynamics_crm/xml/money.rb', line 7

def initialize(value, precision=2)
  @value = "%.#{precision}f" % value
end

Instance Attribute Details

#valueObject

Returns the value of attribute value.



5
6
7
# File 'lib/dynamics_crm/xml/money.rb', line 5

def value
  @value
end

Instance Method Details

#to_xml(options = {}) ⇒ Object



11
12
13
# File 'lib/dynamics_crm/xml/money.rb', line 11

def to_xml(options={})
  "<a:Value>#{@value}</a:Value>"
end