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.



24845
24846
24847
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24845

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



24843
24844
24845
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24843

def value
  @value
end

Class Method Details

.ALLObject



24865
24866
24867
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24865

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



24850
24851
24852
24853
24854
24855
24856
24857
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24850

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



24875
24876
24877
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24875

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



24860
24861
24862
24863
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24860

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



24870
24871
24872
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24870

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

Instance Method Details

#to_hashObject



24879
24880
24881
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24879

def to_hash
  value
end