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.



26878
26879
26880
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26878

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



26876
26877
26878
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26876

def value
  @value
end

Class Method Details

.ALLObject



26898
26899
26900
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26898

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



26883
26884
26885
26886
26887
26888
26889
26890
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26883

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.



26903
26904
26905
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26903

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



26893
26894
26895
26896
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26893

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.



26908
26909
26910
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26908

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

.restrictedObject

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



26914
26915
26916
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26914

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

Instance Method Details

#to_hashObject



26918
26919
26920
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26918

def to_hash
  value
end