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.



19672
19673
19674
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19672

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



19670
19671
19672
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19670

def value
  @value
end

Class Method Details

.ALLObject



19692
19693
19694
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19692

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



19677
19678
19679
19680
19681
19682
19683
19684
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19677

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.



19697
19698
19699
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19697

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



19687
19688
19689
19690
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19687

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.



19702
19703
19704
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19702

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

.restrictedObject

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



19708
19709
19710
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19708

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

Instance Method Details

#to_hashObject



19712
19713
19714
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19712

def to_hash
  value
end