Class: EPlat::Mapping::Shopify::V202407::Product::Option

Inherits:
Base
  • Object
show all
Defined in:
lib/e_plat/mapping/shopify/v_2024_07/product/option.rb

Constant Summary

Constants inherited from Base

Base::DEFAULT_VALUES

Instance Attribute Summary

Attributes inherited from Base

#resource, #virtual_collection

Instance Method Summary collapse

Methods inherited from 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



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/e_plat/mapping/shopify/v_2024_07/product/option.rb', line 19

def native_attribute_aliases
	super.concat([
		
		{
			existing_entry: {native_key: "id", e_plat_key: "id",
				custom_e_plat_getter: '-> { _1&.split("/")&.last }',
				custom_native_setter: '-> { "gid://shopify/ProductOption/#{_1}" }'
			}
		},
		{
			existing_entry: {native_key: "name", e_plat_key: "name"}
		},
		{
			existing_entry: {native_key: "position", e_plat_key: "position"}
		},
		{
			existing_entry: {native_key: "values", e_plat_key: "values"}
		}
	])
end

#native_attributesObject



15
16
17
# File 'lib/e_plat/mapping/shopify/v_2024_07/product/option.rb', line 15

def native_attributes
	super
end

#native_top_keyObject



11
12
13
# File 'lib/e_plat/mapping/shopify/v_2024_07/product/option.rb', line 11

def native_top_key
	:itself
end