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.



26279
26280
26281
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26279

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



26277
26278
26279
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26277

def value
  @value
end

Class Method Details

.ALLObject



26299
26300
26301
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26299

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



26284
26285
26286
26287
26288
26289
26290
26291
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26284

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



26294
26295
26296
26297
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26294

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

.privateObject



26307
26308
26309
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26307

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

.publicObject



26303
26304
26305
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26303

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

Instance Method Details

#to_hashObject



26311
26312
26313
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26311

def to_hash
  value
end