Class: Currency::Exchange::Rate::Writable
- Inherits:
-
Currency::Exchange::Rate
- Object
- Currency::Exchange::Rate
- Currency::Exchange::Rate::Writable
- Defined in:
- lib/currency/exchange/rate.rb
Instance Attribute Summary collapse
-
#derived ⇒ Object
writeonly
Sets the attribute derived.
-
#rate ⇒ Object
writeonly
Sets the attribute rate.
-
#source ⇒ Object
writeonly
Sets the attribute source.
Attributes inherited from Currency::Exchange::Rate
#c1, #c2, #date, #date_0, #date_1, #derived, #rate, #rate_avg, #rate_date_0, #rate_date_1, #rate_hi, #rate_lo, #rate_samples, #source
Instance Method Summary collapse
-
#initialize(c1 = nil, c2 = nil, rate = nil, *opts) ⇒ Writable
constructor
A new instance of Writable.
Methods inherited from Currency::Exchange::Rate
#collect_rate, #collect_rates, #convert, #inspect, #reciprocal, #to_s
Constructor Details
#initialize(c1 = nil, c2 = nil, rate = nil, *opts) ⇒ Writable
Returns a new instance of Writable.
209 210 211 212 |
# File 'lib/currency/exchange/rate.rb', line 209 def initialize(c1 = nil, c2 = nil, rate = nil, *opts) super(c1, c2, 0.0, *opts) @rate = rate end |
Instance Attribute Details
#derived=(value) ⇒ Object (writeonly)
Sets the attribute derived
207 208 209 |
# File 'lib/currency/exchange/rate.rb', line 207 def derived=(value) @derived = value end |
#rate=(value) ⇒ Object (writeonly)
Sets the attribute rate
208 209 210 |
# File 'lib/currency/exchange/rate.rb', line 208 def rate=(value) @rate = value end |
#source=(value) ⇒ Object (writeonly)
Sets the attribute source
206 207 208 |
# File 'lib/currency/exchange/rate.rb', line 206 def source=(value) @source = value end |