Class: Io::Flow::V0::Models::OrderOptions
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::OrderOptions
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Optional behaviors to enable for this order
Instance Attribute Summary collapse
-
#storage ⇒ Object
readonly
Returns the value of attribute storage.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ OrderOptions
constructor
A new instance of OrderOptions.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ OrderOptions
Returns a new instance of OrderOptions.
46609 46610 46611 46612 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46609 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) @storage = (x = (x = opts.delete(:storage); x.nil? ? "persist" : x); x.is_a?(::Io::Flow::V0::Models::OrderStorage) ? x : ::Io::Flow::V0::Models::OrderStorage.apply(x)) end |
Instance Attribute Details
#storage ⇒ Object (readonly)
Returns the value of attribute storage.
46607 46608 46609 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46607 def storage @storage end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
46618 46619 46620 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46618 def copy(incoming={}) OrderOptions.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
46622 46623 46624 46625 46626 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46622 def to_hash { :storage => storage.value } end |
#to_json ⇒ Object
46614 46615 46616 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46614 def to_json JSON.dump(to_hash) end |