Method: EPlat::Base#initialize
- Defined in:
- lib/e_plat/resource/base.rb
#initialize(attributes = {}, persisted = false) ⇒ Base
Returns a new instance of Base.
102 103 104 105 106 107 108 109 110 111 112 113 114 115 |
# File 'lib/e_plat/resource/base.rb', line 102 def initialize(attributes = {}, persisted = false) site = client.base_url ActiveResource::Base.include_root_in_json = client.shopify? && top_level_resource? # attributes.reject!{ _1.starts_with? "_"} # remove private attributes, e.g. WooCommerce's '_links' super self.mapping = mapping_instance @mapped_attributes = ensure_e_plat_attributes! ensure_native_attributes! add_aliases!(mapping.native_attribute_aliases, type_schema || {}) end |