Module: Epages::REST::Legal

Includes:
Utils
Included in:
API
Defined in:
lib/epages/rest/legal.rb

Overview

Instance Method Summary collapse

Methods included from Utils

build_shop_from, camelize_keys, camelize_words, options_to_multipart_request, options_to_patch_request, parse_attribute_as, parse_attribute_as_array_of, parse_attributes, symbolize_keys!, to_query_options, underscorize_keys

Instance Method Details

#contact_info(options = {}) ⇒ Object



16
17
18
19
# File 'lib/epages/rest/legal.rb', line 16

def contact_info(options = {})
  response = perform_get_request('/legal/contact-information', options)
  underscorize_keys(response)
end


10
11
12
13
# File 'lib/epages/rest/legal.rb', line 10

def legal(options = {})
  response = perform_get_request('/legal', options)
  parse_legal_info(response)
end

#privacy_policy(options = {}) ⇒ Object



29
30
31
32
# File 'lib/epages/rest/legal.rb', line 29

def privacy_policy(options = {})
  response = perform_get_request('/legal/privacy-policy', options)
  underscorize_keys(response)
end

#rights_of_withdrawal(options = {}) ⇒ Object



55
56
57
58
# File 'lib/epages/rest/legal.rb', line 55

def rights_of_withdrawal(options = {})
  response = perform_get_request('/legal/rights-of-withdrawal', options)
  underscorize_keys(response)
end

#shipping_info(options = {}) ⇒ Object



68
69
70
71
# File 'lib/epages/rest/legal.rb', line 68

def shipping_info(options = {})
  response = perform_get_request('/legal/shipping-information', options)
  underscorize_keys(response)
end

#terms_and_conditions(options = {}) ⇒ Object



42
43
44
45
# File 'lib/epages/rest/legal.rb', line 42

def terms_and_conditions(options = {})
  response = perform_get_request('/legal/terms-and-conditions', options)
  underscorize_keys(response)
end

#update_contact_info(options, locale = 'en_GB') ⇒ Object



22
23
24
25
26
# File 'lib/epages/rest/legal.rb', line 22

def update_contact_info(options, locale = 'en_GB')
  old_data = contact_info(locale: locale)
  response = perform_put_request("/legal/contact-information?locale=#{locale}", old_data.merge(options))
  underscorize_keys(response)
end

#update_privacy_policy(options, locale = 'en_GB') ⇒ Object



35
36
37
38
39
# File 'lib/epages/rest/legal.rb', line 35

def update_privacy_policy(options, locale = 'en_GB')
  old_data = privacy_policy(locale: locale)
  response = perform_put_request("/legal/privacy-policy?locale=#{locale}", old_data.merge(options))
  underscorize_keys(response)
end

#update_rights_of_withdrawal(options, locale = 'en_GB') ⇒ Object



61
62
63
64
65
# File 'lib/epages/rest/legal.rb', line 61

def update_rights_of_withdrawal(options, locale = 'en_GB')
  old_data = rights_of_withdrawal(locale: locale)
  response = perform_put_request("/legal/rights-of-withdrawal?locale=#{locale}", old_data.merge(options))
  underscorize_keys(response)
end

#update_shipping_info(options, locale = 'en_GB') ⇒ Object



74
75
76
77
78
# File 'lib/epages/rest/legal.rb', line 74

def update_shipping_info(options, locale = 'en_GB')
  old_data = shipping_info(locale: locale)
  response = perform_put_request("/legal/shipping-information?locale=#{locale}", old_data.merge(options))
  underscorize_keys(response)
end

#update_terms_and_conditions(options, locale = 'en_GB') ⇒ Object



48
49
50
51
52
# File 'lib/epages/rest/legal.rb', line 48

def update_terms_and_conditions(options, locale = 'en_GB')
  old_data = terms_and_conditions(locale: locale)
  response = perform_put_request("/legal/terms-and-conditions?locale=#{locale}", old_data.merge(options))
  underscorize_keys(response)
end