Class: Killbill::CurrencyPlugin::TestPlugin

Inherits:
Plugin::Currency
  • Object
show all
Defined in:
lib/currency_plugin_test/api.rb

Instance Method Summary collapse

Instance Method Details

#get_base_currencies(options = {}) ⇒ Object


9
10
11
# File 'lib/currency_plugin_test/api.rb', line 9

def get_base_currencies(options = {})
  ['USD']
end

#get_conversion_dates(base_currency, options = {}) ⇒ Object


17
18
19
# File 'lib/currency_plugin_test/api.rb', line 17

def get_conversion_dates(base_currency, options = {})
  [Time.now.utc]
end

#get_current_rates(base_currency, options = {}) ⇒ Object


21
22
23
24
25
26
27
28
# File 'lib/currency_plugin_test/api.rb', line 21

def get_current_rates(base_currency, options = {})
  rate                 = Killbill::Plugin::Model::Rate.new
  rate.base_currency   = base_currency
  rate.currency        = 'BRL'
  rate.value           = 12.3
  rate.conversion_date = Time.now.utc
  [rate]
end

#get_latest_conversion_date(base_currency, options = {}) ⇒ Object


13
14
15
# File 'lib/currency_plugin_test/api.rb', line 13

def get_latest_conversion_date(base_currency, options = {})
  Time.now.utc
end

#get_rates(base_currency, conversion_date, options = {}) ⇒ Object


30
31
32
# File 'lib/currency_plugin_test/api.rb', line 30

def get_rates(base_currency, conversion_date, options = {})
  get_current_rates(base_currency, options)
end