Class: Ice::Instrumentation::ConnectionState

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

Constant Summary collapse

ConnectionStateValidating =
ConnectionState.new("ConnectionStateValidating", 0)
ConnectionStateHolding =
ConnectionState.new("ConnectionStateHolding", 1)
ConnectionStateActive =
ConnectionState.new("ConnectionStateActive", 2)
ConnectionStateClosing =
ConnectionState.new("ConnectionStateClosing", 3)
ConnectionStateClosed =
ConnectionState.new("ConnectionStateClosed", 4)
@@_enumerators =
{0=>ConnectionStateValidating, 1=>ConnectionStateHolding, 2=>ConnectionStateActive, 3=>ConnectionStateClosing, 4=>ConnectionStateClosed}

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, value) ⇒ ConnectionState

Returns a new instance of ConnectionState.



89
90
91
92
# File 'lib/Ice/Instrumentation.rb', line 89

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

Class Method Details

._enumeratorsObject



127
128
129
# File 'lib/Ice/Instrumentation.rb', line 127

def ConnectionState._enumerators
    @@_enumerators
end

.each(&block) ⇒ Object



115
116
117
# File 'lib/Ice/Instrumentation.rb', line 115

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

.from_int(val) ⇒ Object



94
95
96
# File 'lib/Ice/Instrumentation.rb', line 94

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

Instance Method Details

#<=>(other) ⇒ Object



106
107
108
109
# File 'lib/Ice/Instrumentation.rb', line 106

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

#hashObject



111
112
113
# File 'lib/Ice/Instrumentation.rb', line 111

def hash
    @value.hash
end

#to_iObject



102
103
104
# File 'lib/Ice/Instrumentation.rb', line 102

def to_i
    @value
end

#to_sObject



98
99
100
# File 'lib/Ice/Instrumentation.rb', line 98

def to_s
    @name
end