Class: Io::Flow::V0::Models::PriceBookStatus

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) ⇒ PriceBookStatus

Returns a new instance of PriceBookStatus.



18800
18801
18802
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18800

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



18798
18799
18800
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18798

def value
  @value
end

Class Method Details

.ALLObject



18820
18821
18822
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18820

def PriceBookStatus.ALL
  @@all ||= [PriceBookStatus.draft, PriceBookStatus.published, PriceBookStatus.archived]
end

.apply(value) ⇒ Object

Returns the instance of PriceBookStatus for this value, creating a new instance for an unknown value



18805
18806
18807
18808
18809
18810
18811
18812
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18805

def PriceBookStatus.apply(value)
  if value.instance_of?(PriceBookStatus)
    value
  else
    HttpClient::Preconditions.assert_class_or_nil('value', value, String)
    value.nil? ? nil : (from_string(value) || PriceBookStatus.new(value))
  end
end

.archivedObject



18832
18833
18834
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18832

def PriceBookStatus.archived
  @@_archived ||= PriceBookStatus.new('archived')
end

.draftObject



18824
18825
18826
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18824

def PriceBookStatus.draft
  @@_draft ||= PriceBookStatus.new('draft')
end

.from_string(value) ⇒ Object

Returns the instance of PriceBookStatus for this value, or nil if not found



18815
18816
18817
18818
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18815

def PriceBookStatus.from_string(value)
  HttpClient::Preconditions.assert_class('value', value, String)
  PriceBookStatus.ALL.find { |v| v.value == value }
end

.publishedObject



18828
18829
18830
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18828

def PriceBookStatus.published
  @@_published ||= PriceBookStatus.new('published')
end

Instance Method Details

#to_hashObject



18836
18837
18838
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18836

def to_hash
  value
end