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.



13324
13325
13326
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13324

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



13322
13323
13324
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13322

def value
  @value
end

Class Method Details

.ALLObject



13344
13345
13346
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13344

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



13329
13330
13331
13332
13333
13334
13335
13336
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13329

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



13348
13349
13350
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13348

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



13339
13340
13341
13342
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13339

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

.organizationObject



13352
13353
13354
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13352

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

Instance Method Details

#to_hashObject



13356
13357
13358
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13356

def to_hash
  value
end