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.



12379
12380
12381
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12379

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



12377
12378
12379
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12377

def value
  @value
end

Class Method Details

.activeObject



12407
12408
12409
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12407

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

.ALLObject



12399
12400
12401
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12399

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



12384
12385
12386
12387
12388
12389
12390
12391
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12384

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



12417
12418
12419
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12417

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.



12413
12414
12415
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12413

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

.draftObject



12403
12404
12405
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12403

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



12394
12395
12396
12397
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12394

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



12421
12422
12423
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12421

def to_hash
  value
end