Class: Io::Flow::V0::Models::FraudEmailRuleDecision

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#valueObject (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

.ALLObject



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

.approvedObject

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

.declinedObject

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_hashObject



20749
20750
20751
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20749

def to_hash
  value
end