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.



17925
17926
17927
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17925

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



17923
17924
17925
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17923

def value
  @value
end

Class Method Details

.ALLObject



17945
17946
17947
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17945

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



17930
17931
17932
17933
17934
17935
17936
17937
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17930

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



17940
17941
17942
17943
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17940

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

.privateObject



17953
17954
17955
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17953

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

.publicObject



17949
17950
17951
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17949

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

Instance Method Details

#to_hashObject



17957
17958
17959
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17957

def to_hash
  value
end