Class: Io::Flow::V0::Models::FeeDeductionType

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

Returns a new instance of FeeDeductionType.



20486
20487
20488
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20486

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



20484
20485
20486
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20484

def value
  @value
end

Class Method Details

.ALLObject



20506
20507
20508
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20506

def FeeDeductionType.ALL
  @@all ||= [FeeDeductionType.duty_guarantee, FeeDeductionType.mor, FeeDeductionType.fraud, FeeDeductionType.fx, FeeDeductionType.processing, FeeDeductionType.rate_lock, FeeDeductionType.transfer]
end

.apply(value) ⇒ Object

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



20491
20492
20493
20494
20495
20496
20497
20498
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20491

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

.duty_guaranteeObject



20510
20511
20512
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20510

def FeeDeductionType.duty_guarantee
  @@_duty_guarantee ||= FeeDeductionType.new('duty_guarantee')
end

.fraudObject



20518
20519
20520
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20518

def FeeDeductionType.fraud
  @@_fraud ||= FeeDeductionType.new('fraud')
end

.from_string(value) ⇒ Object

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



20501
20502
20503
20504
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20501

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

.fxObject



20522
20523
20524
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20522

def FeeDeductionType.fx
  @@_fx ||= FeeDeductionType.new('fx')
end

.morObject



20514
20515
20516
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20514

def FeeDeductionType.mor
  @@_mor ||= FeeDeductionType.new('mor')
end

.processingObject



20526
20527
20528
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20526

def FeeDeductionType.processing
  @@_processing ||= FeeDeductionType.new('processing')
end

.rate_lockObject



20530
20531
20532
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20530

def FeeDeductionType.rate_lock
  @@_rate_lock ||= FeeDeductionType.new('rate_lock')
end

.transferObject



20534
20535
20536
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20534

def FeeDeductionType.transfer
  @@_transfer ||= FeeDeductionType.new('transfer')
end

Instance Method Details

#to_hashObject



20538
20539
20540
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20538

def to_hash
  value
end