Class: VlatkoDawanda::Currency
- Inherits:
-
Object
- Object
- VlatkoDawanda::Currency
- Includes:
- Comparable
- Defined in:
- lib/vlatko_dawanda/currency.rb
Instance Attribute Summary collapse
-
#iso_code ⇒ Object
readonly
Returns the value of attribute iso_code.
-
#rate ⇒ Object
readonly
Returns the value of attribute rate.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
-
#initialize(options = {}) ⇒ Currency
constructor
A new instance of Currency.
Constructor Details
#initialize(options = {}) ⇒ Currency
Returns a new instance of Currency.
7 8 9 10 |
# File 'lib/vlatko_dawanda/currency.rb', line 7 def initialize( = {}) @iso_code = [:iso_code] @rate = validate_rate([:rate]) end |
Instance Attribute Details
#iso_code ⇒ Object (readonly)
Returns the value of attribute iso_code.
5 6 7 |
# File 'lib/vlatko_dawanda/currency.rb', line 5 def iso_code @iso_code end |
#rate ⇒ Object (readonly)
Returns the value of attribute rate.
5 6 7 |
# File 'lib/vlatko_dawanda/currency.rb', line 5 def rate @rate end |
Instance Method Details
#<=>(other) ⇒ Object
12 13 14 |
# File 'lib/vlatko_dawanda/currency.rb', line 12 def <=>(other) rate <=> other.rate end |