Class: Io::Flow::V0::Models::ZeroAmountIndicator
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::ZeroAmountIndicator
- 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 ZeroAmountIndicator for this value, creating a new instance for an unknown value.
-
.free ⇒ Object
Show the word ‘FREE` in the label.
-
.from_string(value) ⇒ Object
Returns the instance of ZeroAmountIndicator for this value, or nil if not found.
-
.zero ⇒ Object
Show the number 0.00 in the label.
Instance Method Summary collapse
-
#initialize(value) ⇒ ZeroAmountIndicator
constructor
A new instance of ZeroAmountIndicator.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ ZeroAmountIndicator
Returns a new instance of ZeroAmountIndicator.
21901 21902 21903 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21901 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
21899 21900 21901 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21899 def value @value end |
Class Method Details
.ALL ⇒ Object
21921 21922 21923 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21921 def ZeroAmountIndicator.ALL @@all ||= [ZeroAmountIndicator.zero, ZeroAmountIndicator.free] end |
.apply(value) ⇒ Object
Returns the instance of ZeroAmountIndicator for this value, creating a new instance for an unknown value
21906 21907 21908 21909 21910 21911 21912 21913 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21906 def ZeroAmountIndicator.apply(value) if value.instance_of?(ZeroAmountIndicator) value else HttpClient::Preconditions.assert_class_or_nil('value', value, String) value.nil? ? nil : (from_string(value) || ZeroAmountIndicator.new(value)) end end |
.free ⇒ Object
Show the word ‘FREE` in the label
21931 21932 21933 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21931 def ZeroAmountIndicator.free @@_free ||= ZeroAmountIndicator.new('free') end |
.from_string(value) ⇒ Object
Returns the instance of ZeroAmountIndicator for this value, or nil if not found
21916 21917 21918 21919 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21916 def ZeroAmountIndicator.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) ZeroAmountIndicator.ALL.find { |v| v.value == value } end |
.zero ⇒ Object
Show the number 0.00 in the label
21926 21927 21928 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21926 def ZeroAmountIndicator.zero @@_zero ||= ZeroAmountIndicator.new('zero') end |
Instance Method Details
#to_hash ⇒ Object
21935 21936 21937 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21935 def to_hash value end |