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.
20871 20872 20873 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20871 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
20869 20870 20871 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20869 def value @value end |
Class Method Details
.ALL ⇒ Object
20891 20892 20893 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20891 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
20876 20877 20878 20879 20880 20881 20882 20883 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20876 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
20901 20902 20903 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20901 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
20886 20887 20888 20889 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20886 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
20896 20897 20898 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20896 def ZeroAmountIndicator.zero @@_zero ||= ZeroAmountIndicator.new('zero') end |
Instance Method Details
#to_hash ⇒ Object
20905 20906 20907 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20905 def to_hash value end |