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.



15814
15815
15816
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15814

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



15812
15813
15814
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15812

def value
  @value
end

Class Method Details

.ALLObject



15834
15835
15836
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15834

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



15819
15820
15821
15822
15823
15824
15825
15826
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15819

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.



15839
15840
15841
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15839

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



15829
15830
15831
15832
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15829

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.



15844
15845
15846
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15844

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

.restrictedObject

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



15850
15851
15852
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15850

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

Instance Method Details

#to_hashObject



15854
15855
15856
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15854

def to_hash
  value
end