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.



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

Parameters:

  • value

    the value to set the attribute derived to.



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

Parameters:

  • value

    the value to set the attribute rate to.



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

Parameters:

  • value

    the value to set the attribute source to.



195
196
197
# File 'lib/currency/exchange/rate.rb', line 195

def source=(value)
  @source = value
end