Class: Io::Flow::V0::Models::FraudEmailRuleDecision
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::FraudEmailRuleDecision
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Class Method Summary collapse
- .ALL ⇒ Object
-
.apply(value) ⇒ Object
Returns the instance of FraudEmailRuleDecision for this value, creating a new instance for an unknown value.
-
.approved ⇒ Object
Approve all orders matching the customers email address.
-
.declined ⇒ Object
Decline all orders matching the customers email address.
-
.from_string(value) ⇒ Object
Returns the instance of FraudEmailRuleDecision for this value, or nil if not found.
Instance Method Summary collapse
-
#initialize(value) ⇒ FraudEmailRuleDecision
constructor
A new instance of FraudEmailRuleDecision.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ FraudEmailRuleDecision
Returns a new instance of FraudEmailRuleDecision.
18464 18465 18466 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18464 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
18462 18463 18464 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18462 def value @value end |
Class Method Details
.ALL ⇒ Object
18484 18485 18486 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18484 def FraudEmailRuleDecision.ALL @@all ||= [FraudEmailRuleDecision.approved, FraudEmailRuleDecision.declined] end |
.apply(value) ⇒ Object
Returns the instance of FraudEmailRuleDecision for this value, creating a new instance for an unknown value
18469 18470 18471 18472 18473 18474 18475 18476 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18469 def FraudEmailRuleDecision.apply(value) if value.instance_of?(FraudEmailRuleDecision) value else HttpClient::Preconditions.assert_class_or_nil('value', value, String) value.nil? ? nil : (from_string(value) || FraudEmailRuleDecision.new(value)) end end |
.approved ⇒ Object
Approve all orders matching the customers email address.
18489 18490 18491 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18489 def FraudEmailRuleDecision.approved @@_approved ||= FraudEmailRuleDecision.new('approved') end |
.declined ⇒ Object
Decline all orders matching the customers email address.
18494 18495 18496 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18494 def FraudEmailRuleDecision.declined @@_declined ||= FraudEmailRuleDecision.new('declined') end |
.from_string(value) ⇒ Object
Returns the instance of FraudEmailRuleDecision for this value, or nil if not found
18479 18480 18481 18482 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18479 def FraudEmailRuleDecision.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) FraudEmailRuleDecision.ALL.find { |v| v.value == value } end |
Instance Method Details
#to_hash ⇒ Object
18498 18499 18500 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18498 def to_hash value end |