Module: Teamlab::CrmCommon
- Included in:
- Crm
- Defined in:
- lib/teamlab/modules/crm/crm_common.rb
Overview
Methods for working with crm common methods
Instance Method Summary collapse
- #create_currency_rate(from = 'EUR', to = 'USD', rate = '1.0') ⇒ Object
- #delete_currency_rate_by_id(id) ⇒ Object
- #get_all_currency_rates ⇒ Object
- #get_currency_list ⇒ Object
-
#get_currency_rate_by_currency(from_currency, to_currency) ⇒ Hash
Get currency rate by currencies.
- #get_currency_rate_by_id(id) ⇒ Object
- #get_result_of_convertation(options = {}) ⇒ Object
- #get_summary_table(currency) ⇒ Object
- #set_is_portal_configured(options = {}) ⇒ Object
- #update_crm_currency(currency) ⇒ Object
-
#update_currency_rate(id, from, to, rate) ⇒ Hash
Update currency rate object.
Instance Method Details
#create_currency_rate(from = 'EUR', to = 'USD', rate = '1.0') ⇒ Object
26 27 28 |
# File 'lib/teamlab/modules/crm/crm_common.rb', line 26 def create_currency_rate(from = 'EUR', to = 'USD', rate = '1.0') @request.post(%w[currency rates], fromCurrency: from, toCurrency: to, rate: rate) end |
#delete_currency_rate_by_id(id) ⇒ Object
42 43 44 |
# File 'lib/teamlab/modules/crm/crm_common.rb', line 42 def delete_currency_rate_by_id(id) @request.delete(['currency', 'rates', id.to_s], {}) end |
#get_all_currency_rates ⇒ Object
22 23 24 |
# File 'lib/teamlab/modules/crm/crm_common.rb', line 22 def get_all_currency_rates @request.get(%w[currency rates], {}) end |
#get_currency_list ⇒ Object
6 7 8 |
# File 'lib/teamlab/modules/crm/crm_common.rb', line 6 def get_currency_list @request.get(%w[settings currency]) end |
#get_currency_rate_by_currency(from_currency, to_currency) ⇒ Hash
Get currency rate by currencies
38 39 40 |
# File 'lib/teamlab/modules/crm/crm_common.rb', line 38 def get_currency_rate_by_currency(from_currency, to_currency) @request.get(['currency', 'rates', from_currency.to_s, to_currency.to_s]) end |
#get_currency_rate_by_id(id) ⇒ Object
30 31 32 |
# File 'lib/teamlab/modules/crm/crm_common.rb', line 30 def get_currency_rate_by_id(id) @request.get(['currency', 'rates', id.to_s], {}) end |
#get_result_of_convertation(options = {}) ⇒ Object
10 11 12 |
# File 'lib/teamlab/modules/crm/crm_common.rb', line 10 def get_result_of_convertation( = {}) @request.get(%w[settings currency convert], ) end |
#get_summary_table(currency) ⇒ Object
14 15 16 |
# File 'lib/teamlab/modules/crm/crm_common.rb', line 14 def get_summary_table(currency) @request.get(%w[settings currency summarytable], currency: currency) end |
#set_is_portal_configured(options = {}) ⇒ Object
46 47 48 |
# File 'lib/teamlab/modules/crm/crm_common.rb', line 46 def set_is_portal_configured( = {}) @request.put(%w[settings], ) end |
#update_crm_currency(currency) ⇒ Object
18 19 20 |
# File 'lib/teamlab/modules/crm/crm_common.rb', line 18 def update_crm_currency(currency) @request.put(%w[settings currency], currency: currency) end |
#update_currency_rate(id, from, to, rate) ⇒ Hash
Update currency rate object
56 57 58 |
# File 'lib/teamlab/modules/crm/crm_common.rb', line 56 def update_currency_rate(id, from, to, rate) @request.put(['currency', 'rates', id.to_s], fromCurrency: from, toCurrency: to, rate: rate) end |