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.



13899
13900
13901
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13899

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



13897
13898
13899
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13897

def value
  @value
end

Class Method Details

.ALLObject



13919
13920
13921
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13919

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



13904
13905
13906
13907
13908
13909
13910
13911
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13904

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



13931
13932
13933
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13931

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

.draftObject



13923
13924
13925
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13923

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



13914
13915
13916
13917
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13914

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

.publishedObject



13927
13928
13929
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13927

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

Instance Method Details

#to_hashObject



13935
13936
13937
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13935

def to_hash
  value
end