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.



14392
14393
14394
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14392

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



14390
14391
14392
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14390

def value
  @value
end

Class Method Details

.ALLObject



14412
14413
14414
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14412

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



14397
14398
14399
14400
14401
14402
14403
14404
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14397

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



14416
14417
14418
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14416

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



14407
14408
14409
14410
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14407

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

.reservedObject



14420
14421
14422
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14420

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

.soldObject



14424
14425
14426
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14424

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

Instance Method Details

#to_hashObject



14428
14429
14430
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14428

def to_hash
  value
end