Class: Io::Flow::V0::Models::SurchargeResponsibleParty
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::SurchargeResponsibleParty
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Class Method Summary collapse
- .ALL ⇒ Object
-
.apply(value) ⇒ Object
Returns the instance of SurchargeResponsibleParty for this value, creating a new instance for an unknown value.
-
.customer ⇒ Object
The customer pays for this surcharge.
-
.from_string(value) ⇒ Object
Returns the instance of SurchargeResponsibleParty for this value, or nil if not found.
-
.organization ⇒ Object
The merchant pays for this surcharge.
Instance Method Summary collapse
-
#initialize(value) ⇒ SurchargeResponsibleParty
constructor
A new instance of SurchargeResponsibleParty.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ SurchargeResponsibleParty
Returns a new instance of SurchargeResponsibleParty.
20353 20354 20355 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20353 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
20351 20352 20353 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20351 def value @value end |
Class Method Details
.ALL ⇒ Object
20373 20374 20375 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20373 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
20358 20359 20360 20361 20362 20363 20364 20365 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20358 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 |
.customer ⇒ Object
The customer pays for this surcharge
20383 20384 20385 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20383 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
20368 20369 20370 20371 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20368 def SurchargeResponsibleParty.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) SurchargeResponsibleParty.ALL.find { |v| v.value == value } end |
.organization ⇒ Object
The merchant pays for this surcharge
20378 20379 20380 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20378 def SurchargeResponsibleParty.organization @@_organization ||= SurchargeResponsibleParty.new('organization') end |
Instance Method Details
#to_hash ⇒ Object
20387 20388 20389 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20387 def to_hash value end |