Class: Currency::Exchange::Rate::Writable

Inherits:
Currency::Exchange::Rate show all
Defined in:
lib/currency/exchange/rate.rb

Instance Attribute Summary collapse

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

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

Parameters:

  • value

    the value to set the attribute derived to.



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

Parameters:

  • value

    the value to set the attribute rate to.



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

Parameters:

  • value

    the value to set the attribute source to.



206
207
208
# File 'lib/currency/exchange/rate.rb', line 206

def source=(value)
  @source = value
end