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.
-
#payment_method ⇒ Object
readonly
Returns the value of attribute payment_method.
-
#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.
23433 23434 23435 23436 23437 23438 23439 23440 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23433 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:tags, :payment_method, :display_position], 'PaymentMethodRule') = 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)) }) end |
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content.
23431 23432 23433 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23431 def content @content end |
#display_position ⇒ Object (readonly)
Returns the value of attribute display_position.
23431 23432 23433 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23431 def display_position @display_position end |
#payment_method ⇒ Object (readonly)
Returns the value of attribute payment_method.
23431 23432 23433 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23431 def payment_method @payment_method end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
23431 23432 23433 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23431 def end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
23446 23447 23448 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23446 def copy(incoming={}) PaymentMethodRule.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
23450 23451 23452 23453 23454 23455 23456 23457 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23450 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 } } end |
#to_json ⇒ Object
23442 23443 23444 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23442 def to_json JSON.dump(to_hash) end |