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.



15338
15339
15340
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15338

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



15336
15337
15338
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15336

def value
  @value
end

Class Method Details

.ALLObject



15358
15359
15360
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15358

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



15343
15344
15345
15346
15347
15348
15349
15350
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15343

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



15362
15363
15364
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15362

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



15353
15354
15355
15356
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15353

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

.reservedObject



15366
15367
15368
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15366

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

.soldObject



15370
15371
15372
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15370

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

Instance Method Details

#to_hashObject



15374
15375
15376
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15374

def to_hash
  value
end