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.



37151
37152
37153
37154
37155
37156
37157
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37151

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.



37149
37150
37151
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37149

def payment_method_id
  @payment_method_id
end

#qObject (readonly)

Returns the value of attribute q.



37149
37150
37151
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37149

def q
  @q
end

#tagsObject (readonly)

Returns the value of attribute tags.



37149
37150
37151
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37149

def tags
  @tags
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



37163
37164
37165
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37163

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

#to_hashObject



37167
37168
37169
37170
37171
37172
37173
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37167

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

#to_jsonObject



37159
37160
37161
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37159

def to_json
  JSON.dump(to_hash)
end