Class: Io::Flow::V0::Models::Visibility

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) ⇒ Visibility

Returns a new instance of Visibility.



10902
10903
10904
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10902

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



10900
10901
10902
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10900

def value
  @value
end

Class Method Details

.ALLObject



10922
10923
10924
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10922

def Visibility.ALL
  @@all ||= [Visibility.public, Visibility.private]
end

.apply(value) ⇒ Object

Returns the instance of Visibility for this value, creating a new instance for an unknown value



10907
10908
10909
10910
10911
10912
10913
10914
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10907

def Visibility.apply(value)
  if value.instance_of?(Visibility)
    value
  else
    HttpClient::Preconditions.assert_class_or_nil('value', value, String)
    value.nil? ? nil : (from_string(value) || Visibility.new(value))
  end
end

.from_string(value) ⇒ Object

Returns the instance of Visibility for this value, or nil if not found



10917
10918
10919
10920
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10917

def Visibility.from_string(value)
  HttpClient::Preconditions.assert_class('value', value, String)
  Visibility.ALL.find { |v| v.value == value }
end

.privateObject



10930
10931
10932
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10930

def Visibility.private
  @@_private ||= Visibility.new('private')
end

.publicObject



10926
10927
10928
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10926

def Visibility.public
  @@_public ||= Visibility.new('public')
end

Instance Method Details

#to_hashObject



10934
10935
10936
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10934

def to_hash
  value
end