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.
10190 10191 10192 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10190 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
10188 10189 10190 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10188 def value @value end |
Class Method Details
.ALL ⇒ Object
10210 10211 10212 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10210 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
10195 10196 10197 10198 10199 10200 10201 10202 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10195 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
10218 10219 10220 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10218 def AvailabilityStatus.disabled @@_disabled ||= AvailabilityStatus.new('disabled') end |
.enabled ⇒ Object
10214 10215 10216 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10214 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
10205 10206 10207 10208 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10205 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
10222 10223 10224 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10222 def to_hash value end |