Class: Io::Flow::V0::Models::SubcatalogItemStatus

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) ⇒ SubcatalogItemStatus

Returns a new instance of SubcatalogItemStatus.



18388
18389
18390
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18388

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



18386
18387
18388
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18386

def value
  @value
end

Class Method Details

.ALLObject



18408
18409
18410
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18408

def SubcatalogItemStatus.ALL
  @@all ||= [SubcatalogItemStatus.excluded, SubcatalogItemStatus.included, SubcatalogItemStatus.restricted]
end

.apply(value) ⇒ Object

Returns the instance of SubcatalogItemStatus for this value, creating a new instance for an unknown value



18393
18394
18395
18396
18397
18398
18399
18400
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18393

def SubcatalogItemStatus.apply(value)
  if value.instance_of?(SubcatalogItemStatus)
    value
  else
    HttpClient::Preconditions.assert_class_or_nil('value', value, String)
    value.nil? ? nil : (from_string(value) || SubcatalogItemStatus.new(value))
  end
end

.excludedObject

The user has chosen to exclude the item from the associated subcatalog.



18413
18414
18415
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18413

def SubcatalogItemStatus.excluded
  @@_excluded ||= SubcatalogItemStatus.new('excluded')
end

.from_string(value) ⇒ Object

Returns the instance of SubcatalogItemStatus for this value, or nil if not found



18403
18404
18405
18406
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18403

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

.includedObject

The item is included in the associated subcatalog.



18418
18419
18420
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18418

def SubcatalogItemStatus.included
  @@_included ||= SubcatalogItemStatus.new('included')
end

.restrictedObject

Item is not allowed to be sold in the market associated with the given subcatalog.



18424
18425
18426
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18424

def SubcatalogItemStatus.restricted
  @@_restricted ||= SubcatalogItemStatus.new('restricted')
end

Instance Method Details

#to_hashObject



18428
18429
18430
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18428

def to_hash
  value
end