Class: Io::Flow::V0::Models::OrderIdentifierPutForm

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ OrderIdentifierPutForm

Returns a new instance of OrderIdentifierPutForm.



29888
29889
29890
29891
29892
29893
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29888

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:order], 'OrderIdentifierPutForm')
  @order = HttpClient::Preconditions.assert_class('order', opts.delete(:order), String)
  @primary = (x = opts.delete(:primary); x.nil? ? nil : HttpClient::Preconditions.assert_boolean('primary', x))
end

Instance Attribute Details

#orderObject (readonly)

Returns the value of attribute order.



29886
29887
29888
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29886

def order
  @order
end

#primaryObject (readonly)

Returns the value of attribute primary.



29886
29887
29888
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29886

def primary
  @primary
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



29899
29900
29901
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29899

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

#to_hashObject



29903
29904
29905
29906
29907
29908
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29903

def to_hash
  {
    :order => order,
    :primary => primary
  }
end

#to_jsonObject



29895
29896
29897
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29895

def to_json
  JSON.dump(to_hash)
end