Class: Io::Flow::V0::Models::SerialStatus

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ SerialStatus

Returns a new instance of SerialStatus.



16051
16052
16053
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16051

def initialize(value)
  @value = HttpClient::Preconditions.assert_class('value', value, String)
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



16049
16050
16051
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16049

def value
  @value
end

Class Method Details

.ALLObject



16071
16072
16073
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16071

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



16056
16057
16058
16059
16060
16061
16062
16063
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16056

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

.availableObject



16075
16076
16077
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16075

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



16066
16067
16068
16069
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16066

def SerialStatus.from_string(value)
  HttpClient::Preconditions.assert_class('value', value, String)
  SerialStatus.ALL.find { |v| v.value == value }
end

.reservedObject



16079
16080
16081
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16079

def SerialStatus.reserved
  @@_reserved ||= SerialStatus.new('reserved')
end

.soldObject



16083
16084
16085
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16083

def SerialStatus.sold
  @@_sold ||= SerialStatus.new('sold')
end

Instance Method Details

#to_hashObject



16087
16088
16089
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16087

def to_hash
  value
end