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.



13026
13027
13028
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13026

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



13024
13025
13026
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13024

def value
  @value
end

Class Method Details

.ALLObject



13046
13047
13048
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13046

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



13031
13032
13033
13034
13035
13036
13037
13038
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13031

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.



13051
13052
13053
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13051

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



13041
13042
13043
13044
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13041

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.



13056
13057
13058
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13056

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

.restrictedObject

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



13062
13063
13064
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13062

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

Instance Method Details

#to_hashObject



13066
13067
13068
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13066

def to_hash
  value
end