Class: Io::Flow::V0::Models::ExperienceCheckoutSettings

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

Returns a new instance of ExperienceCheckoutSettings.



31684
31685
31686
31687
31688
31689
31690
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31684

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:id, :experience, :checkout_configuration], 'ExperienceCheckoutSettings')
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
  @experience = (x = opts.delete(:experience); x.is_a?(::Io::Flow::V0::Models::ExperienceOverview) ? x : ::Io::Flow::V0::Models::ExperienceOverview.new(x))
  @checkout_configuration = (x = opts.delete(:checkout_configuration); x.is_a?(::Io::Flow::V0::Models::ExperienceConfigurationReference) ? x : ::Io::Flow::V0::Models::ExperienceConfigurationReference.new(x))
end

Instance Attribute Details

#checkout_configurationObject (readonly)

Returns the value of attribute checkout_configuration.



31682
31683
31684
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31682

def checkout_configuration
  @checkout_configuration
end

#experienceObject (readonly)

Returns the value of attribute experience.



31682
31683
31684
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31682

def experience
  @experience
end

#idObject (readonly)

Returns the value of attribute id.



31682
31683
31684
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31682

def id
  @id
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



31696
31697
31698
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31696

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

#to_hashObject



31700
31701
31702
31703
31704
31705
31706
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31700

def to_hash
  {
    :id => id,
    :experience => experience.to_hash,
    :checkout_configuration => checkout_configuration.to_hash
  }
end

#to_jsonObject



31692
31693
31694
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31692

def to_json
  JSON.dump(to_hash)
end