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.
18438 18439 18440 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18438 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
18436 18437 18438 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18436 def value @value end |
Class Method Details
.ALL ⇒ Object
18458 18459 18460 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18458 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
18443 18444 18445 18446 18447 18448 18449 18450 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18443 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
18468 18469 18470 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18468 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
18453 18454 18455 18456 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18453 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
18463 18464 18465 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18463 def SurchargeResponsibleParty.organization @@_organization ||= SurchargeResponsibleParty.new('organization') end |
Instance Method Details
#to_hash ⇒ Object
18472 18473 18474 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18472 def to_hash value end |