Class: Io::Flow::V0::Models::ExperiencePaymentMethodRule

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

Returns a new instance of ExperiencePaymentMethodRule.



31733
31734
31735
31736
31737
31738
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31733

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:experience_key, :payment_method_rules], 'ExperiencePaymentMethodRule')
  @experience_key = HttpClient::Preconditions.assert_class('experience_key', opts.delete(:experience_key), String)
  @payment_method_rules = HttpClient::Preconditions.assert_class('payment_method_rules', opts.delete(:payment_method_rules), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::PaymentMethodRule) ? x : ::Io::Flow::V0::Models::PaymentMethodRule.new(x)) }
end

Instance Attribute Details

#experience_keyObject (readonly)

Returns the value of attribute experience_key.



31731
31732
31733
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31731

def experience_key
  @experience_key
end

#payment_method_rulesObject (readonly)

Returns the value of attribute payment_method_rules.



31731
31732
31733
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31731

def payment_method_rules
  @payment_method_rules
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



31744
31745
31746
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31744

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

#to_hashObject



31748
31749
31750
31751
31752
31753
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31748

def to_hash
  {
    :experience_key => experience_key,
    :payment_method_rules => payment_method_rules.map { |o| o.to_hash }
  }
end

#to_jsonObject



31740
31741
31742
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31740

def to_json
  JSON.dump(to_hash)
end