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.



16220
16221
16222
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16220

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



16218
16219
16220
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16218

def value
  @value
end

Class Method Details

.ALLObject



16240
16241
16242
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16240

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



16225
16226
16227
16228
16229
16230
16231
16232
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16225

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.



16245
16246
16247
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16245

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



16235
16236
16237
16238
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16235

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.



16250
16251
16252
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16250

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

Instance Method Details

#to_hashObject



16254
16255
16256
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16254

def to_hash
  value
end