Class: Io::Flow::V0::Models::PaymentMethodRule
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::PaymentMethodRule
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#display_position ⇒ Object
readonly
Returns the value of attribute display_position.
-
#issuers ⇒ Object
readonly
Returns the value of attribute issuers.
-
#payment_method ⇒ Object
readonly
Returns the value of attribute payment_method.
-
#programs ⇒ Object
readonly
Returns the value of attribute programs.
-
#q ⇒ Object
readonly
Returns the value of attribute q.
-
#tags ⇒ Object
readonly
Returns the value of attribute tags.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ PaymentMethodRule
constructor
A new instance of PaymentMethodRule.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ PaymentMethodRule
Returns a new instance of PaymentMethodRule.
43396 43397 43398 43399 43400 43401 43402 43403 43404 43405 43406 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43396 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:tags, :payment_method, :display_position], 'PaymentMethodRule') @tags = HttpClient::Preconditions.assert_class('tags', opts.delete(:tags), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::PaymentMethodTag) ? x : ::Io::Flow::V0::Models::PaymentMethodTag.from_json(x)) } @payment_method = (x = opts.delete(:payment_method); x.is_a?(::Io::Flow::V0::Models::PaymentMethod) ? x : ::Io::Flow::V0::Models::PaymentMethod.new(x)) @display_position = HttpClient::Preconditions.assert_class('display_position', opts.delete(:display_position), Integer) @content = (x = opts.delete(:content); x.nil? ? nil : HttpClient::Preconditions.assert_class('content', x, Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::PaymentMethodRuleContent) ? x : ::Io::Flow::V0::Models::PaymentMethodRuleContent.new(x)) }) @issuers = (x = opts.delete(:issuers); x.nil? ? nil : HttpClient::Preconditions.assert_class('issuers', x, Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::PaymentMethodIssuer) ? x : ::Io::Flow::V0::Models::PaymentMethodIssuer.new(x)) }) @programs = (x = opts.delete(:programs); x.nil? ? nil : HttpClient::Preconditions.assert_class('programs', x, Array).map { |v| HttpClient::Preconditions.assert_class('programs', HttpClient::Helper.to_object(v), Hash) }) @q = (x = opts.delete(:q); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Query) ? x : ::Io::Flow::V0::Models::Query.new(x))) end |
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content.
43394 43395 43396 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43394 def content @content end |
#display_position ⇒ Object (readonly)
Returns the value of attribute display_position.
43394 43395 43396 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43394 def display_position @display_position end |
#issuers ⇒ Object (readonly)
Returns the value of attribute issuers.
43394 43395 43396 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43394 def issuers @issuers end |
#payment_method ⇒ Object (readonly)
Returns the value of attribute payment_method.
43394 43395 43396 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43394 def payment_method @payment_method end |
#programs ⇒ Object (readonly)
Returns the value of attribute programs.
43394 43395 43396 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43394 def programs @programs end |
#q ⇒ Object (readonly)
Returns the value of attribute q.
43394 43395 43396 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43394 def q @q end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
43394 43395 43396 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43394 def @tags end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
43412 43413 43414 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43412 def copy(incoming={}) PaymentMethodRule.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
43416 43417 43418 43419 43420 43421 43422 43423 43424 43425 43426 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43416 def to_hash { :tags => .map { |o| o.to_hash }, :payment_method => payment_method.to_hash, :display_position => display_position, :content => content.nil? ? nil : content.map { |o| o.to_hash }, :issuers => issuers.nil? ? nil : issuers.map { |o| o.to_hash }, :programs => programs.nil? ? nil : programs, :q => q.nil? ? nil : q.to_hash } end |
#to_json ⇒ Object
43408 43409 43410 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43408 def to_json JSON.dump(to_hash) end |