Class: EPlat::Mapping::Bigcommerce::V3::Shop

Inherits:
EPlat::Mapping::Base show all
Defined in:
lib/e_plat/mapping/bigcommerce/v_3/shop.rb

Constant Summary

Constants inherited from EPlat::Mapping::Base

EPlat::Mapping::Base::DEFAULT_VALUES

Instance Attribute Summary

Attributes inherited from EPlat::Mapping::Base

#resource, #virtual_collection

Instance Method Summary collapse

Methods inherited from EPlat::Mapping::Base

#aliases, #e_plat_key_to, #initialize, #inspect, #keys_aliased_to_native_keys, #mappable_keys, #mappings, #native_key_to, #native_setter, #to_e_plat_keys, #to_native_keys, #via_native_attributes_where_possible, virtual_collection

Methods included from RequestBodyRoot

#include_root_in_request_body?

Constructor Details

This class inherits a constructor from EPlat::Mapping::Base

Instance Method Details

#native_attribute_aliasesObject



61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# File 'lib/e_plat/mapping/bigcommerce/v_3/shop.rb', line 61

def native_attribute_aliases
	super.concat([
		{
			existing_entry: {native_key:	"id",  e_plat_key: "id", 
				custom_e_plat_getter: "-> (value) { nil }",
				custom_native_setter: "-> (value) { nil }" # not compatible. one is string, one is integer
			}
		},
		{
			existing_entry: {native_key:	"name",	 		e_plat_key: "name"}
		},
		{
			alias_attribute: {native_key:	"admin_email",  e_plat_key: "email"}
		},
		{
			alias_attribute: {native_key:	"control_panel_base_url", e_plat_key: "myshopify_domain", 
				custom_e_plat_getter: "-> (value) { value.split('://').last }",
			}
		},
		{
			existing_entry: {native_key:	"domain",	 	 e_plat_key: "domain"}
		},
		{
			existing_entry: {native_key:	"country",	 	 e_plat_key: "country"}
		},
		{
			alias_attribute: {native_key:	"address", 		 e_plat_key: "address1"}
		},
		{
			existing_entry: {native_key:	"country_code",	 e_plat_key: "country_code"}
		},
		{
			existing_entry: {native_key:	"currency",      e_plat_key: "currency"}
		},
		{
			existing_entry: {native_key:	"plan_name",	   e_plat_key: "plan_name"}
		},
		{
			alias_attribute: {native_key:	"weight_units",	   e_plat_key: "weight_unit"}
		}
	])
end

#native_attributesObject



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/e_plat/mapping/bigcommerce/v_3/shop.rb', line 16

def native_attributes
	super.concat([
		"id",
		"account_uuid",
		"domain",
		"secure_url",
		"control_panel_base_url",
		"status",
		"name",
		"first_name",
		"last_name",
		"address",
		"country",
		"country_code",
		"phone",
		"admin_email",
		"order_email",
		"favicon_url",
		"timezone",
		"language",
		"currency",
		"currency_symbol",
		"decimal_separator",
		"thousands_separator",
		"decimal_places",
		"currency_symbol_location",
		"weight_units",
		"dimension_units",
		"dimension_decimal_places",
		"dimension_decimal_token",
		"dimension_thousands_token",
		"plan_name",
		"plan_level",
		"plan_is_trial",
		"industry",
		"logo",
		"is_price_entered_with_tax",
		"store_id",
		"default_site_id",
		"default_channel_id",
		"active_comparison_modules",
		"features"
	])
end

#native_top_keyObject

BigCommerce uses Store instead of Shop. + also only available in v2 API currently. api.bigcommerce.com/stores/store_hash/v2/store will need to find a way to make compatible



12
13
14
# File 'lib/e_plat/mapping/bigcommerce/v_3/shop.rb', line 12

def native_top_key
	"data"
end