Class: Io::Flow::V0::Models::LevyInclusion
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::LevyInclusion
- 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 LevyInclusion for this value, creating a new instance for an unknown value.
- .duty ⇒ Object
-
.from_string(value) ⇒ Object
Returns the instance of LevyInclusion for this value, or nil if not found.
- .tax ⇒ Object
Instance Method Summary collapse
-
#initialize(value) ⇒ LevyInclusion
constructor
A new instance of LevyInclusion.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ LevyInclusion
Returns a new instance of LevyInclusion.
20485 20486 20487 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20485 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
20483 20484 20485 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20483 def value @value end |
Class Method Details
.ALL ⇒ Object
20505 20506 20507 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20505 def LevyInclusion.ALL @@all ||= [LevyInclusion.tax, LevyInclusion.duty] end |
.apply(value) ⇒ Object
Returns the instance of LevyInclusion for this value, creating a new instance for an unknown value
20490 20491 20492 20493 20494 20495 20496 20497 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20490 def LevyInclusion.apply(value) if value.instance_of?(LevyInclusion) value else HttpClient::Preconditions.assert_class_or_nil('value', value, String) value.nil? ? nil : (from_string(value) || LevyInclusion.new(value)) end end |
.duty ⇒ Object
20513 20514 20515 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20513 def LevyInclusion.duty @@_duty ||= LevyInclusion.new('duty') end |
.from_string(value) ⇒ Object
Returns the instance of LevyInclusion for this value, or nil if not found
20500 20501 20502 20503 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20500 def LevyInclusion.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) LevyInclusion.ALL.find { |v| v.value == value } end |
.tax ⇒ Object
20509 20510 20511 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20509 def LevyInclusion.tax @@_tax ||= LevyInclusion.new('tax') end |
Instance Method Details
#to_hash ⇒ Object
20517 20518 20519 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20517 def to_hash value end |