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.
20715 20716 20717 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20715 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
20713 20714 20715 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20713 def value @value end |
Class Method Details
.ALL ⇒ Object
20735 20736 20737 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20735 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
20720 20721 20722 20723 20724 20725 20726 20727 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20720 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.
20740 20741 20742 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20740 def FraudEmailRuleDecision.approved @@_approved ||= FraudEmailRuleDecision.new('approved') end |
.declined ⇒ Object
Decline all orders matching the customers email address.
20745 20746 20747 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20745 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
20730 20731 20732 20733 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20730 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
20749 20750 20751 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20749 def to_hash value end |