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
-
#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.
21888 21889 21890 21891 21892 21893 21894 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21888 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) end |
Instance Attribute Details
#display_position ⇒ Object (readonly)
Returns the value of attribute display_position.
21886 21887 21888 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21886 def display_position @display_position end |
#payment_method ⇒ Object (readonly)
Returns the value of attribute payment_method.
21886 21887 21888 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21886 def payment_method @payment_method end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
21886 21887 21888 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21886 def @tags end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
21900 21901 21902 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21900 def copy(incoming={}) PaymentMethodRule.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
21904 21905 21906 21907 21908 21909 21910 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21904 def to_hash { :tags => .map { |o| o.to_hash }, :payment_method => payment_method.to_hash, :display_position => display_position } end |
#to_json ⇒ Object
21896 21897 21898 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21896 def to_json JSON.dump(to_hash) end |