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.



17979
17980
17981
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17979

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



17977
17978
17979
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17977

def value
  @value
end

Class Method Details

.ALLObject



17999
18000
18001
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17999

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



17984
17985
17986
17987
17988
17989
17990
17991
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17984

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



18011
18012
18013
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18011

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

.draftObject



18003
18004
18005
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18003

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



17994
17995
17996
17997
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17994

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

.publishedObject



18007
18008
18009
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18007

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

Instance Method Details

#to_hashObject



18015
18016
18017
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18015

def to_hash
  value
end