Class: Io::Flow::V0::Models::OrderCancellationForm

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Overview

An order cancellation form will update all item quantities to 0. The implementation is a convenience method that wraps an order_update_form

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ OrderCancellationForm

Returns a new instance of OrderCancellationForm.



21561
21562
21563
21564
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21561

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  @attributes = (x = opts.delete(:attributes); x.nil? ? nil : HttpClient::Preconditions.assert_class('attributes', x, Hash).inject({}) { |h, d| h[d[0]] = HttpClient::Preconditions.assert_class('attributes', d[1], String); h })
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



21559
21560
21561
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21559

def attributes
  @attributes
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



21570
21571
21572
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21570

def copy(incoming={})
  OrderCancellationForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end

#to_hashObject



21574
21575
21576
21577
21578
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21574

def to_hash
  {
    :attributes => attributes.nil? ? nil : attributes
  }
end

#to_jsonObject



21566
21567
21568
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21566

def to_json
  JSON.dump(to_hash)
end