Class: DynamicsCRM::XML::Money
- Inherits:
-
Object
- Object
- DynamicsCRM::XML::Money
- Defined in:
- lib/dynamics_crm/xml/money.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(value, precision = 2) ⇒ Money
constructor
A new instance of Money.
- #to_xml(options = {}) ⇒ Object
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
#value ⇒ Object
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(={}) "<a:Value>#{@value}</a:Value>" end |