Class: Io::Flow::V0::Models::AvailabilityStatus
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::AvailabilityStatus
- 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 AvailabilityStatus for this value, creating a new instance for an unknown value.
- .disabled ⇒ Object
- .enabled ⇒ Object
-
.from_string(value) ⇒ Object
Returns the instance of AvailabilityStatus for this value, or nil if not found.
Instance Method Summary collapse
-
#initialize(value) ⇒ AvailabilityStatus
constructor
A new instance of AvailabilityStatus.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ AvailabilityStatus
Returns a new instance of AvailabilityStatus.
13173 13174 13175 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13173 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
13171 13172 13173 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13171 def value @value end |
Class Method Details
.ALL ⇒ Object
13193 13194 13195 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13193 def AvailabilityStatus.ALL @@all ||= [AvailabilityStatus.enabled, AvailabilityStatus.disabled] end |
.apply(value) ⇒ Object
Returns the instance of AvailabilityStatus for this value, creating a new instance for an unknown value
13178 13179 13180 13181 13182 13183 13184 13185 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13178 def AvailabilityStatus.apply(value) if value.instance_of?(AvailabilityStatus) value else HttpClient::Preconditions.assert_class_or_nil('value', value, String) value.nil? ? nil : (from_string(value) || AvailabilityStatus.new(value)) end end |
.disabled ⇒ Object
13201 13202 13203 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13201 def AvailabilityStatus.disabled @@_disabled ||= AvailabilityStatus.new('disabled') end |
.enabled ⇒ Object
13197 13198 13199 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13197 def AvailabilityStatus.enabled @@_enabled ||= AvailabilityStatus.new('enabled') end |
.from_string(value) ⇒ Object
Returns the instance of AvailabilityStatus for this value, or nil if not found
13188 13189 13190 13191 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13188 def AvailabilityStatus.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) AvailabilityStatus.ALL.find { |v| v.value == value } end |
Instance Method Details
#to_hash ⇒ Object
13205 13206 13207 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13205 def to_hash value end |