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.



16201
16202
16203
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16201

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



16199
16200
16201
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16199

def value
  @value
end

Class Method Details

.ALLObject



16221
16222
16223
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16221

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



16206
16207
16208
16209
16210
16211
16212
16213
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16206

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



16216
16217
16218
16219
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16216

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

.privateObject



16229
16230
16231
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16229

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

.publicObject



16225
16226
16227
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16225

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

Instance Method Details

#to_hashObject



16233
16234
16235
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16233

def to_hash
  value
end