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.



11762
11763
11764
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11762

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



11760
11761
11762
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11760

def value
  @value
end

Class Method Details

.activeObject



11790
11791
11792
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11790

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

.ALLObject



11782
11783
11784
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11782

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

.apply(value) ⇒ Object

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



11767
11768
11769
11770
11771
11772
11773
11774
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11767

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



11800
11801
11802
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11800

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

.archivingObject

Archiving indicates an experience has been archived. We allow some time for sessions to expire before fully marking the experience archived.



11796
11797
11798
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11796

def ExperienceStatus.archiving
  @@_archiving ||= ExperienceStatus.new('archiving')
end

.draftObject



11786
11787
11788
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11786

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



11777
11778
11779
11780
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11777

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



11804
11805
11806
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11804

def to_hash
  value
end