Class: Io::Flow::V0::Models::ExperiencePaymentMethodRuleForm

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

Returns a new instance of ExperiencePaymentMethodRuleForm.



24024
24025
24026
24027
24028
24029
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24024

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:payment_method_id, :tags], 'ExperiencePaymentMethodRuleForm')
  @payment_method_id = HttpClient::Preconditions.assert_class('payment_method_id', opts.delete(:payment_method_id), String)
  @tags = HttpClient::Preconditions.assert_class('tags', opts.delete(:tags), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::ExperiencePaymentMethodTag) ? x : ::Io::Flow::V0::Models::ExperiencePaymentMethodTag.apply(x)) }
end

Instance Attribute Details

#payment_method_idObject (readonly)

Returns the value of attribute payment_method_id.



24022
24023
24024
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24022

def payment_method_id
  @payment_method_id
end

#tagsObject (readonly)

Returns the value of attribute tags.



24022
24023
24024
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24022

def tags
  @tags
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



24035
24036
24037
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24035

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

#to_hashObject



24039
24040
24041
24042
24043
24044
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24039

def to_hash
  {
    :payment_method_id => payment_method_id,
    :tags => tags.map { |o| o.value }
  }
end

#to_jsonObject



24031
24032
24033
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24031

def to_json
  JSON.dump(to_hash)
end