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.



21298
21299
21300
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21298

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



21296
21297
21298
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21296

def value
  @value
end

Class Method Details

.ALLObject



21318
21319
21320
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21318

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



21303
21304
21305
21306
21307
21308
21309
21310
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21303

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



21313
21314
21315
21316
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21313

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

.privateObject



21326
21327
21328
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21326

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

.publicObject



21322
21323
21324
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21322

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

Instance Method Details

#to_hashObject



21330
21331
21332
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21330

def to_hash
  value
end