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.



16970
16971
16972
16973
16974
16975
16976
16977
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16970

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.



16968
16969
16970
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16968

def commercial_invoice
  @commercial_invoice
end

#crossdockObject (readonly)

Returns the value of attribute crossdock.



16968
16969
16970
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16968

def crossdock
  @crossdock
end

#domestic_shippingObject (readonly)

Returns the value of attribute domestic_shipping.



16968
16969
16970
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16968

def domestic_shipping
  @domestic_shipping
end

#internal_shippingObject (readonly)

Returns the value of attribute internal_shipping.



16968
16969
16970
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16968

def internal_shipping
  @internal_shipping
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



16983
16984
16985
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16983

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

#to_hashObject



16987
16988
16989
16990
16991
16992
16993
16994
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16987

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

#to_jsonObject



16979
16980
16981
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16979

def to_json
  JSON.dump(to_hash)
end