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.
-
#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.
32375 32376 32377 32378 32379 32380 32381 32382 32383 32384 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32375 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:tags, :payment_method, :display_position, :programs], '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 = HttpClient::Preconditions.assert_class('programs', opts.delete(:programs), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::InstallmentProgramSummary) ? x : ::Io::Flow::V0::Models::InstallmentProgramSummary.new(x)) } end |
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content.
32373 32374 32375 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32373 def content @content end |
#display_position ⇒ Object (readonly)
Returns the value of attribute display_position.
32373 32374 32375 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32373 def display_position @display_position end |
#issuers ⇒ Object (readonly)
Returns the value of attribute issuers.
32373 32374 32375 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32373 def issuers @issuers end |
#payment_method ⇒ Object (readonly)
Returns the value of attribute payment_method.
32373 32374 32375 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32373 def payment_method @payment_method end |
#programs ⇒ Object (readonly)
Returns the value of attribute programs.
32373 32374 32375 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32373 def programs @programs end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
32373 32374 32375 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32373 def @tags end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
32390 32391 32392 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32390 def copy(incoming={}) PaymentMethodRule.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
32394 32395 32396 32397 32398 32399 32400 32401 32402 32403 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32394 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.map { |o| o.to_hash } } end |
#to_json ⇒ Object
32386 32387 32388 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32386 def to_json JSON.dump(to_hash) end |