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.



11587
11588
11589
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11587

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



11585
11586
11587
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11585

def value
  @value
end

Class Method Details

.ALLObject



11607
11608
11609
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11607

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



11592
11593
11594
11595
11596
11597
11598
11599
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11592

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



11619
11620
11621
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11619

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

.draftObject



11611
11612
11613
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11611

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



11602
11603
11604
11605
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11602

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

.publishedObject



11615
11616
11617
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11615

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

Instance Method Details

#to_hashObject



11623
11624
11625
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11623

def to_hash
  value
end