Class: Io::Flow::V0::Models::SurchargeResponsibleParty

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

Returns a new instance of SurchargeResponsibleParty.



20720
20721
20722
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20720

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



20718
20719
20720
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20718

def value
  @value
end

Class Method Details

.ALLObject



20740
20741
20742
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20740

def SurchargeResponsibleParty.ALL
  @@all ||= [SurchargeResponsibleParty.organization, SurchargeResponsibleParty.customer]
end

.apply(value) ⇒ Object

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



20725
20726
20727
20728
20729
20730
20731
20732
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20725

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

.customerObject

The customer pays for this surcharge



20750
20751
20752
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20750

def SurchargeResponsibleParty.customer
  @@_customer ||= SurchargeResponsibleParty.new('customer')
end

.from_string(value) ⇒ Object

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



20735
20736
20737
20738
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20735

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

.organizationObject

The merchant pays for this surcharge



20745
20746
20747
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20745

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

Instance Method Details

#to_hashObject



20754
20755
20756
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20754

def to_hash
  value
end