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.



20342
20343
20344
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20342

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



20340
20341
20342
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20340

def value
  @value
end

Class Method Details

.activeObject



20370
20371
20372
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20370

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

.ALLObject



20362
20363
20364
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20362

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



20347
20348
20349
20350
20351
20352
20353
20354
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20347

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



20380
20381
20382
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20380

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.



20376
20377
20378
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20376

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

.draftObject



20366
20367
20368
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20366

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



20357
20358
20359
20360
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20357

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



20384
20385
20386
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20384

def to_hash
  value
end