Class: Io::Flow::V0::Models::WithholdingDeductionType
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::WithholdingDeductionType
- 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 WithholdingDeductionType for this value, creating a new instance for an unknown value.
- .duty ⇒ Object
- .freight ⇒ Object
-
.from_string(value) ⇒ Object
Returns the instance of WithholdingDeductionType for this value, or nil if not found.
- .insurance ⇒ Object
- .tax ⇒ Object
Instance Method Summary collapse
-
#initialize(value) ⇒ WithholdingDeductionType
constructor
A new instance of WithholdingDeductionType.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ WithholdingDeductionType
Returns a new instance of WithholdingDeductionType.
28506 28507 28508 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28506 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
28504 28505 28506 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28504 def value @value end |
Class Method Details
.ALL ⇒ Object
28526 28527 28528 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28526 def WithholdingDeductionType.ALL @@all ||= [WithholdingDeductionType.tax, WithholdingDeductionType.duty, WithholdingDeductionType.freight, WithholdingDeductionType.insurance] end |
.apply(value) ⇒ Object
Returns the instance of WithholdingDeductionType for this value, creating a new instance for an unknown value
28511 28512 28513 28514 28515 28516 28517 28518 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28511 def WithholdingDeductionType.apply(value) if value.instance_of?(WithholdingDeductionType) value else HttpClient::Preconditions.assert_class_or_nil('value', value, String) value.nil? ? nil : (from_string(value) || WithholdingDeductionType.new(value)) end end |
.duty ⇒ Object
28534 28535 28536 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28534 def WithholdingDeductionType.duty @@_duty ||= WithholdingDeductionType.new('duty') end |
.freight ⇒ Object
28538 28539 28540 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28538 def WithholdingDeductionType.freight @@_freight ||= WithholdingDeductionType.new('freight') end |
.from_string(value) ⇒ Object
Returns the instance of WithholdingDeductionType for this value, or nil if not found
28521 28522 28523 28524 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28521 def WithholdingDeductionType.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) WithholdingDeductionType.ALL.find { |v| v.value == value } end |
.insurance ⇒ Object
28542 28543 28544 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28542 def WithholdingDeductionType.insurance @@_insurance ||= WithholdingDeductionType.new('insurance') end |
.tax ⇒ Object
28530 28531 28532 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28530 def WithholdingDeductionType.tax @@_tax ||= WithholdingDeductionType.new('tax') end |
Instance Method Details
#to_hash ⇒ Object
28546 28547 28548 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28546 def to_hash value end |