Class: EPlat::Order
- Includes:
- Concerns::Metafieldable
- Defined in:
- lib/e_plat/resource/order.rb
Direct Known Subclasses
Defined Under Namespace
Classes: BillingAddress, Consignment, Fulfillment, LineItem, ShippingAddress, ShippingLine
Constant Summary
Constants included from Concerns::GraphQLable
Concerns::GraphQLable::FILTER_ARGS, Concerns::GraphQLable::QUERY_ARG_ARGS
Instance Attribute Summary
Attributes inherited from Base
Attributes included from Concerns::Aliases
Instance Method Summary collapse
Methods included from Concerns::Metafieldable
#add_metafield, #find_metafield, #metafields
Methods inherited from Base
cached_shopify_webhook?, client, #client, exclude_from_json, #formatted_id, #graphql_input, #headers, #include_root_in_json, inherited, #initialize, initialize_singleton!, #mapped?, #native_keys, platform_specific_class?, prefix=, #read_only?
Methods included from Countable
Methods included from Concerns::GraphQLable
#graphql_mutation_string, #mutate_graphql, #remove_mutation_root_from
Methods included from Concerns::Aliases
Methods included from Concerns::FullJson
Methods included from Concerns::OverwriteRequestMethods
#collection_path, #element_path, included
Methods included from Concerns::OverwriteInstanceMethods
#as_eplat_json, #as_json, #create, #create_resource_for, #to_eplat_json, #to_json, #update
Constructor Details
This class inherits a constructor from EPlat::Base
Instance Method Details
#cancel(options = {}) ⇒ Object
106 107 108 109 110 111 112 113 |
# File 'lib/e_plat/resource/order.rb', line 106 def cancel( = {}) if client.bigcommerce? self.status_id = 5 save else load_attributes_from_response(post(:cancel, {}, .to_json)) end end |
#cancelled? ⇒ Boolean
115 116 117 118 119 120 121 122 |
# File 'lib/e_plat/resource/order.rb', line 115 def cancelled? case client.platform when :shopify cancelled_at.present? when :bigcommerce status_id == 5 end end |