Class: Io::Flow::V0::Models::SerialStatus
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::SerialStatus
- 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 SerialStatus for this value, creating a new instance for an unknown value.
- .available ⇒ Object
-
.from_string(value) ⇒ Object
Returns the instance of SerialStatus for this value, or nil if not found.
- .reserved ⇒ Object
- .sold ⇒ Object
Instance Method Summary collapse
-
#initialize(value) ⇒ SerialStatus
constructor
A new instance of SerialStatus.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ SerialStatus
Returns a new instance of SerialStatus.
14926 14927 14928 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14926 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
14924 14925 14926 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14924 def value @value end |
Class Method Details
.ALL ⇒ Object
14946 14947 14948 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14946 def SerialStatus.ALL @@all ||= [SerialStatus.available, SerialStatus.reserved, SerialStatus.sold] end |
.apply(value) ⇒ Object
Returns the instance of SerialStatus for this value, creating a new instance for an unknown value
14931 14932 14933 14934 14935 14936 14937 14938 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14931 def SerialStatus.apply(value) if value.instance_of?(SerialStatus) value else HttpClient::Preconditions.assert_class_or_nil('value', value, String) value.nil? ? nil : (from_string(value) || SerialStatus.new(value)) end end |
.available ⇒ Object
14950 14951 14952 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14950 def SerialStatus.available @@_available ||= SerialStatus.new('available') end |
.from_string(value) ⇒ Object
Returns the instance of SerialStatus for this value, or nil if not found
14941 14942 14943 14944 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14941 def SerialStatus.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) SerialStatus.ALL.find { |v| v.value == value } end |
.reserved ⇒ Object
14954 14955 14956 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14954 def SerialStatus.reserved @@_reserved ||= SerialStatus.new('reserved') end |
.sold ⇒ Object
14958 14959 14960 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14958 def SerialStatus.sold @@_sold ||= SerialStatus.new('sold') end |
Instance Method Details
#to_hash ⇒ Object
14962 14963 14964 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14962 def to_hash value end |