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.



16178
16179
16180
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16178

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



16176
16177
16178
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16176

def value
  @value
end

Class Method Details

.activeObject



16206
16207
16208
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16206

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

.ALLObject



16198
16199
16200
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16198

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



16183
16184
16185
16186
16187
16188
16189
16190
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16183

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



16216
16217
16218
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16216

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.



16212
16213
16214
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16212

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

.draftObject



16202
16203
16204
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16202

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



16193
16194
16195
16196
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16193

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



16220
16221
16222
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16220

def to_hash
  value
end