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.



9863
9864
9865
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9863

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



9861
9862
9863
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9861

def value
  @value
end

Class Method Details

.activeObject



9891
9892
9893
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9891

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

.ALLObject



9883
9884
9885
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9883

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



9868
9869
9870
9871
9872
9873
9874
9875
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9868

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



9895
9896
9897
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9895

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

.draftObject



9887
9888
9889
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9887

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



9878
9879
9880
9881
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9878

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



9899
9900
9901
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9899

def to_hash
  value
end