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



29020
29021
29022
29023
29024
29025
29026
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29020

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.



29018
29019
29020
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29018

def checkout_configuration
  @checkout_configuration
end

#experienceObject (readonly)

Returns the value of attribute experience.



29018
29019
29020
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29018

def experience
  @experience
end

#idObject (readonly)

Returns the value of attribute id.



29018
29019
29020
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29018

def id
  @id
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



29032
29033
29034
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29032

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

#to_hashObject



29036
29037
29038
29039
29040
29041
29042
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29036

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

#to_jsonObject



29028
29029
29030
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29028

def to_json
  JSON.dump(to_hash)
end