Class: NCore::BigMoney
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- NCore::BigMoney
- Defined in:
- lib/ncore/attributes.rb
Instance Method Summary collapse
-
#initialize(*args) ⇒ BigMoney
constructor
A new instance of BigMoney.
- #to_s ⇒ Object
Constructor Details
#initialize(*args) ⇒ BigMoney
Returns a new instance of BigMoney.
171 172 173 |
# File 'lib/ncore/attributes.rb', line 171 def initialize(*args) __setobj__(BigDecimal(*args)) end |
Instance Method Details
#to_s ⇒ Object
175 176 177 178 179 180 181 |
# File 'lib/ncore/attributes.rb', line 175 def to_s if (self % BigDecimal('0.01')) == 0 '%.2f' % self else super end end |