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.
17961 17962 17963 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17961 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
17959 17960 17961 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17959 def value @value end |
Class Method Details
.ALL ⇒ Object
17981 17982 17983 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17981 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
17966 17967 17968 17969 17970 17971 17972 17973 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17966 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
17985 17986 17987 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17985 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
17976 17977 17978 17979 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17976 def SerialStatus.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) SerialStatus.ALL.find { |v| v.value == value } end |
.reserved ⇒ Object
17989 17990 17991 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17989 def SerialStatus.reserved @@_reserved ||= SerialStatus.new('reserved') end |
.sold ⇒ Object
17993 17994 17995 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17993 def SerialStatus.sold @@_sold ||= SerialStatus.new('sold') end |
Instance Method Details
#to_hash ⇒ Object
17997 17998 17999 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17997 def to_hash value end |