Class: Io::Flow::V0::Models::LogisticsSettings

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 = {}) ⇒ LogisticsSettings

Returns a new instance of LogisticsSettings.



49349
49350
49351
49352
49353
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49349

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:shipping_configuration], 'LogisticsSettings')
  @shipping_configuration = (x = opts.delete(:shipping_configuration); x.is_a?(::Io::Flow::V0::Models::ShippingConfigurationReference) ? x : ::Io::Flow::V0::Models::ShippingConfigurationReference.new(x))
end

Instance Attribute Details

#shipping_configurationObject (readonly)

Returns the value of attribute shipping_configuration.



49347
49348
49349
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49347

def shipping_configuration
  @shipping_configuration
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



49359
49360
49361
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49359

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

#to_hashObject



49363
49364
49365
49366
49367
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49363

def to_hash
  {
    :shipping_configuration => shipping_configuration.to_hash
  }
end

#to_jsonObject



49355
49356
49357
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49355

def to_json
  JSON.dump(to_hash)
end