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.



24468
24469
24470
24471
24472
24473
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24468

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.



24466
24467
24468
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24466

def order
  @order
end

#primaryObject (readonly)

Returns the value of attribute primary.



24466
24467
24468
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24466

def primary
  @primary
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



24479
24480
24481
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24479

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

#to_hashObject



24483
24484
24485
24486
24487
24488
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24483

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

#to_jsonObject



24475
24476
24477
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24475

def to_json
  JSON.dump(to_hash)
end