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
12954 12955 12956 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12954 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
12952 12953 12954 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12952 def value @value end |
Class Method Details
.ALL ⇒ Object
12974 12975 12976 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12974 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
12959 12960 12961 12962 12963 12964 12965 12966 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12959 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
12978 12979 12980 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12978 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
12969 12970 12971 12972 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12969 def SerialStatus.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) SerialStatus.ALL.find { |v| v.value == value } end |
.reserved ⇒ Object
12982 12983 12984 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12982 def SerialStatus.reserved @@_reserved ||= SerialStatus.new('reserved') end |
.sold ⇒ Object
12986 12987 12988 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12986 def SerialStatus.sold @@_sold ||= SerialStatus.new('sold') end |
Instance Method Details
#to_hash ⇒ Object
12990 12991 12992 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12990 def to_hash value end |