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.



11980
11981
11982
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11980

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



11978
11979
11980
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11978

def value
  @value
end

Class Method Details

.ALLObject



12000
12001
12002
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12000

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



11985
11986
11987
11988
11989
11990
11991
11992
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11985

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



12004
12005
12006
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12004

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



11995
11996
11997
11998
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11995

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

.organizationObject



12008
12009
12010
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12008

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

Instance Method Details

#to_hashObject



12012
12013
12014
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12012

def to_hash
  value
end