Class: EPlat::Mapping::Bigcommerce::V3::Product
- Inherits:
-
EPlat::Mapping::Base
- Object
- EPlat::Mapping::Base
- EPlat::Mapping::Bigcommerce::V3::Product
- Defined in:
- lib/e_plat/mapping/bigcommerce/v_3/product.rb,
lib/e_plat/mapping/bigcommerce/v_3/product/image.rb,
lib/e_plat/mapping/bigcommerce/v_3/product/option.rb,
lib/e_plat/mapping/bigcommerce/v_3/product/variant.rb
Defined Under Namespace
Classes: Image, Option, Variant
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_aliases ⇒ Object
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 |
# File 'lib/e_plat/mapping/bigcommerce/v_3/product.rb', line 85 def native_attribute_aliases super.concat([ { alias_attribute: {native_key: "description", e_plat_key: "body_html"} }, { alias_attribute: {native_key: "date_created", e_plat_key: "created_at"}, }, { alias_attribute: {native_key: "name", e_plat_key: "handle", custom_e_plat_getter: "-> (value) { value&.gsub(' ', '-') }", custom_native_setter: "-> (value) { value&.gsub('-', ' ') }" } }, { existing_entry: {native_key: "id", e_plat_key: "id"} }, { alias_attribute: {native_key: "availability", e_plat_key: "status", custom_e_plat_getter: "-> (value) { {'preorder'=>'active', 'available' => 'active', 'disabled' => 'draft'}[value] || value }", custom_native_setter: "-> (value) { {'available' => 'active', 'disabled' => 'draft'}.invert[value] || value }" #invert will merge new duped keys } }, { alias_attribute: {native_key: "type", e_plat_key: "product_type"} }, { alias_attribute: {native_key: "name", e_plat_key: "title"} }, { alias_attribute: {native_key: "date_modified", e_plat_key: "updated_at"} } ]) end |
#native_attributes ⇒ Object
13 14 15 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 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/e_plat/mapping/bigcommerce/v_3/product.rb', line 13 def native_attributes super.concat([ "id", "name", "type", "sku", "description", "weight", "width", "depth", "height", "price", "cost_price", "retail_price", "sale_price", "map_price", "tax_class_id", "product_tax_code", "calculated_price", "categories", "brand_id", "option_set_id", "option_set_display", "inventory_level", "inventory_warning_level", "inventory_tracking", "reviews_rating_sum", "reviews_count", "total_sold", "fixed_cost_shipping_price", "is_free_shipping", "is_visible", "is_featured", "related_products", "warranty", "bin_picking_number", "layout_file", "upc", "mpn", "gtin", "search_keywords", "availability", "availability_description", "gift_wrapping_options_type", "gift_wrapping_options_list", "sort_order", "condition", "is_condition_shown", "order_quantity_minimum", "order_quantity_maximum", "page_title", "meta_keywords", "meta_description", "date_created", "date_modified", "view_count", "preorder_release_date", "preorder_message", "is_preorder_only", "is_price_hidden", "price_hidden_label", "custom_url", "base_variant_id", "open_graph_type", "open_graph_title", "open_graph_description", "open_graph_use_meta_description", "open_graph_use_product_name", "open_graph_use_image" ]) end |
#native_top_key ⇒ Object
9 10 11 |
# File 'lib/e_plat/mapping/bigcommerce/v_3/product.rb', line 9 def native_top_key "data" end |