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.



10082
10083
10084
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10082

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



10080
10081
10082
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10080

def value
  @value
end

Class Method Details

.activeObject



10110
10111
10112
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10110

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

.ALLObject



10102
10103
10104
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10102

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



10087
10088
10089
10090
10091
10092
10093
10094
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10087

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



10114
10115
10116
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10114

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

.draftObject



10106
10107
10108
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10106

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



10097
10098
10099
10100
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10097

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



10118
10119
10120
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10118

def to_hash
  value
end