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.



26928
26929
26930
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26928

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



26926
26927
26928
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26926

def value
  @value
end

Class Method Details

.ALLObject



26948
26949
26950
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26948

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



26933
26934
26935
26936
26937
26938
26939
26940
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26933

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



26958
26959
26960
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26958

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



26943
26944
26945
26946
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26943

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



26953
26954
26955
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26953

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

Instance Method Details

#to_hashObject



26962
26963
26964
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26962

def to_hash
  value
end