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.



12707
12708
12709
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12707

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



12705
12706
12707
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12705

def value
  @value
end

Class Method Details

.ALLObject



12727
12728
12729
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12727

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



12712
12713
12714
12715
12716
12717
12718
12719
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12712

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.



12732
12733
12734
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12732

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



12722
12723
12724
12725
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12722

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.



12737
12738
12739
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12737

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

.restrictedObject

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



12743
12744
12745
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12743

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

Instance Method Details

#to_hashObject



12747
12748
12749
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12747

def to_hash
  value
end