Class: Io::Flow::V0::Models::ExperienceStatus

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

Returns a new instance of ExperienceStatus.



9736
9737
9738
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9736

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



9734
9735
9736
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9734

def value
  @value
end

Class Method Details

.activeObject



9764
9765
9766
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9764

def ExperienceStatus.active
  @@_active ||= ExperienceStatus.new('active')
end

.ALLObject



9756
9757
9758
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9756

def ExperienceStatus.ALL
  @@all ||= [ExperienceStatus.draft, ExperienceStatus.active, ExperienceStatus.archived]
end

.apply(value) ⇒ Object

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



9741
9742
9743
9744
9745
9746
9747
9748
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9741

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

.archivedObject



9768
9769
9770
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9768

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

.draftObject



9760
9761
9762
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9760

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

.from_string(value) ⇒ Object

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



9751
9752
9753
9754
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9751

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

Instance Method Details

#to_hashObject



9772
9773
9774
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9772

def to_hash
  value
end