Class: Ice::ConnectionClose

Inherits:
Object
  • Object
show all
Includes:
Comparable
Defined in:
lib/Ice/Connection.rb

Constant Summary collapse

Forcefully =
ConnectionClose.new("Forcefully", 0)
Gracefully =
ConnectionClose.new("Gracefully", 1)
GracefullyWithWait =
ConnectionClose.new("GracefullyWithWait", 2)
@@_enumerators =
{0=>Forcefully, 1=>Gracefully, 2=>GracefullyWithWait}

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, value) ⇒ ConnectionClose

Returns a new instance of ConnectionClose.



260
261
262
263
# File 'lib/Ice/Connection.rb', line 260

def initialize(name, value)
    @name = name
    @value = value
end

Class Method Details

._enumeratorsObject



296
297
298
# File 'lib/Ice/Connection.rb', line 296

def ConnectionClose._enumerators
    @@_enumerators
end

.each(&block) ⇒ Object



286
287
288
# File 'lib/Ice/Connection.rb', line 286

def ConnectionClose.each(&block)
    @@_enumerators.each_value(&block)
end

.from_int(val) ⇒ Object



265
266
267
# File 'lib/Ice/Connection.rb', line 265

def ConnectionClose.from_int(val)
    @@_enumerators[val]
end

Instance Method Details

#<=>(other) ⇒ Object



277
278
279
280
# File 'lib/Ice/Connection.rb', line 277

def <=>(other)
    other.is_a?(ConnectionClose) or raise ArgumentError, "value must be a ConnectionClose"
    @value <=> other.to_i
end

#hashObject



282
283
284
# File 'lib/Ice/Connection.rb', line 282

def hash
    @value.hash
end

#to_iObject



273
274
275
# File 'lib/Ice/Connection.rb', line 273

def to_i
    @value
end

#to_sObject



269
270
271
# File 'lib/Ice/Connection.rb', line 269

def to_s
    @name
end