Class: Io::Flow::V0::Models::FraudEmailRule
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::FraudEmailRule
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Rule to apply to enable white-listing and black-listing for an email address.
Instance Attribute Summary collapse
-
#decision ⇒ Object
readonly
Returns the value of attribute decision.
-
#email ⇒ Object
readonly
Returns the value of attribute email.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ FraudEmailRule
constructor
A new instance of FraudEmailRule.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ FraudEmailRule
Returns a new instance of FraudEmailRule.
28768 28769 28770 28771 28772 28773 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28768 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:email, :decision], 'FraudEmailRule') @email = HttpClient::Preconditions.assert_class('email', opts.delete(:email), String) @decision = (x = opts.delete(:decision); x.is_a?(::Io::Flow::V0::Models::FraudEmailRuleDecision) ? x : ::Io::Flow::V0::Models::FraudEmailRuleDecision.apply(x)) end |
Instance Attribute Details
#decision ⇒ Object (readonly)
Returns the value of attribute decision.
28766 28767 28768 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28766 def decision @decision end |
#email ⇒ Object (readonly)
Returns the value of attribute email.
28766 28767 28768 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28766 def email @email end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
28779 28780 28781 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28779 def copy(incoming={}) FraudEmailRule.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
28783 28784 28785 28786 28787 28788 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28783 def to_hash { :email => email, :decision => decision.value } end |
#to_json ⇒ Object
28775 28776 28777 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28775 def to_json JSON.dump(to_hash) end |