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.



32361
32362
32363
32364
32365
32366
32367
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32361

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)) }
  @q = (x = opts.delete(:q); x.nil? ? nil : HttpClient::Preconditions.assert_class('q', x, String))
end

Instance Attribute Details

#payment_method_idObject (readonly)

Returns the value of attribute payment_method_id.



32359
32360
32361
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32359

def payment_method_id
  @payment_method_id
end

#qObject (readonly)

Returns the value of attribute q.



32359
32360
32361
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32359

def q
  @q
end

#tagsObject (readonly)

Returns the value of attribute tags.



32359
32360
32361
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32359

def tags
  @tags
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



32373
32374
32375
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32373

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

#to_hashObject



32377
32378
32379
32380
32381
32382
32383
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32377

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

#to_jsonObject



32369
32370
32371
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32369

def to_json
  JSON.dump(to_hash)
end