Class: Io::Flow::V0::Models::CenterCapabilities

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

Overview

Capabilities of each center. This is used when determining if a crossdock solution is required

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ CenterCapabilities

Returns a new instance of CenterCapabilities.



16427
16428
16429
16430
16431
16432
16433
16434
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16427

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:domestic_shipping, :internal_shipping, :commercial_invoice, :crossdock], 'CenterCapabilities')
  @domestic_shipping = HttpClient::Preconditions.assert_boolean('domestic_shipping', opts.delete(:domestic_shipping))
  @internal_shipping = HttpClient::Preconditions.assert_boolean('internal_shipping', opts.delete(:internal_shipping))
  @commercial_invoice = HttpClient::Preconditions.assert_boolean('commercial_invoice', opts.delete(:commercial_invoice))
  @crossdock = HttpClient::Preconditions.assert_boolean('crossdock', opts.delete(:crossdock))
end

Instance Attribute Details

#commercial_invoiceObject (readonly)

Returns the value of attribute commercial_invoice.



16425
16426
16427
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16425

def commercial_invoice
  @commercial_invoice
end

#crossdockObject (readonly)

Returns the value of attribute crossdock.



16425
16426
16427
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16425

def crossdock
  @crossdock
end

#domestic_shippingObject (readonly)

Returns the value of attribute domestic_shipping.



16425
16426
16427
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16425

def domestic_shipping
  @domestic_shipping
end

#internal_shippingObject (readonly)

Returns the value of attribute internal_shipping.



16425
16426
16427
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16425

def internal_shipping
  @internal_shipping
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



16440
16441
16442
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16440

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

#to_hashObject



16444
16445
16446
16447
16448
16449
16450
16451
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16444

def to_hash
  {
    :domestic_shipping => domestic_shipping,
    :internal_shipping => internal_shipping,
    :commercial_invoice => commercial_invoice,
    :crossdock => crossdock
  }
end

#to_jsonObject



16436
16437
16438
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16436

def to_json
  JSON.dump(to_hash)
end