Class: Io::Flow::V0::Models::FraudLiability

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) ⇒ FraudLiability

Returns a new instance of FraudLiability.



15707
15708
15709
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15707

def initialize(value)
  @value = HttpClient::Preconditions.assert_class('value', value, String)
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



15705
15706
15707
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15705

def value
  @value
end

Class Method Details

.ALLObject



15727
15728
15729
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15727

def FraudLiability.ALL
  @@all ||= [FraudLiability.flow, FraudLiability.organization]
end

.apply(value) ⇒ Object

Returns the instance of FraudLiability for this value, creating a new instance for an unknown value



15712
15713
15714
15715
15716
15717
15718
15719
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15712

def FraudLiability.apply(value)
  if value.instance_of?(FraudLiability)
    value
  else
    HttpClient::Preconditions.assert_class_or_nil('value', value, String)
    value.nil? ? nil : (from_string(value) || FraudLiability.new(value))
  end
end

.flowObject

Flow takes any fraud liability for the order.



15732
15733
15734
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15732

def FraudLiability.flow
  @@_flow ||= FraudLiability.new('flow')
end

.from_string(value) ⇒ Object

Returns the instance of FraudLiability for this value, or nil if not found



15722
15723
15724
15725
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15722

def FraudLiability.from_string(value)
  HttpClient::Preconditions.assert_class('value', value, String)
  FraudLiability.ALL.find { |v| v.value == value }
end

.organizationObject

The merchant takes any fraud liability for the order.



15737
15738
15739
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15737

def FraudLiability.organization
  @@_organization ||= FraudLiability.new('organization')
end

Instance Method Details

#to_hashObject



15741
15742
15743
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15741

def to_hash
  value
end