Class: Io::Flow::V0::Models::ExperienceSettings

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

Returns a new instance of ExperienceSettings.



32050
32051
32052
32053
32054
32055
32056
32057
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32050

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:delivered_duty], 'ExperienceSettings')
  @delivered_duty = (x = opts.delete(:delivered_duty); x.is_a?(::Io::Flow::V0::Models::DeliveredDutySetting) ? x : ::Io::Flow::V0::Models::DeliveredDutySetting.new(x))
  @pricing_settings = (x = opts.delete(:pricing_settings); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::PricingSettings) ? x : ::Io::Flow::V0::Models::PricingSettings.new(x)))
  @logistics_settings = (x = opts.delete(:logistics_settings); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::LogisticsSettings) ? x : ::Io::Flow::V0::Models::LogisticsSettings.new(x)))
  @checkout_settings = (x = opts.delete(:checkout_settings); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::ExperienceCheckoutConfigurationSettings) ? x : ::Io::Flow::V0::Models::ExperienceCheckoutConfigurationSettings.new(x)))
end

Instance Attribute Details

#checkout_settingsObject (readonly)

Returns the value of attribute checkout_settings.



32048
32049
32050
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32048

def checkout_settings
  @checkout_settings
end

#delivered_dutyObject (readonly)

Returns the value of attribute delivered_duty.



32048
32049
32050
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32048

def delivered_duty
  @delivered_duty
end

#logistics_settingsObject (readonly)

Returns the value of attribute logistics_settings.



32048
32049
32050
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32048

def logistics_settings
  @logistics_settings
end

#pricing_settingsObject (readonly)

Returns the value of attribute pricing_settings.



32048
32049
32050
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32048

def pricing_settings
  @pricing_settings
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



32063
32064
32065
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32063

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

#to_hashObject



32067
32068
32069
32070
32071
32072
32073
32074
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32067

def to_hash
  {
    :delivered_duty => delivered_duty.to_hash,
    :pricing_settings => pricing_settings.nil? ? nil : pricing_settings.to_hash,
    :logistics_settings => logistics_settings.nil? ? nil : logistics_settings.to_hash,
    :checkout_settings => checkout_settings.nil? ? nil : checkout_settings.to_hash
  }
end

#to_jsonObject



32059
32060
32061
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32059

def to_json
  JSON.dump(to_hash)
end