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.



19749
19750
19751
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19749

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



19747
19748
19749
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19747

def value
  @value
end

Class Method Details

.ALLObject



19769
19770
19771
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19769

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



19754
19755
19756
19757
19758
19759
19760
19761
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19754

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



19779
19780
19781
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19779

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



19764
19765
19766
19767
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19764

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



19774
19775
19776
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19774

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

Instance Method Details

#to_hashObject



19783
19784
19785
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19783

def to_hash
  value
end