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.
198 199 200 201 |
# File 'lib/currency/exchange/rate.rb', line 198 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
196 197 198 |
# File 'lib/currency/exchange/rate.rb', line 196 def derived=(value) @derived = value end |
#rate=(value) ⇒ Object (writeonly)
Sets the attribute rate
197 198 199 |
# File 'lib/currency/exchange/rate.rb', line 197 def rate=(value) @rate = value end |
#source=(value) ⇒ Object (writeonly)
Sets the attribute source
195 196 197 |
# File 'lib/currency/exchange/rate.rb', line 195 def source=(value) @source = value end |