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.



148
149
150
151
# File 'lib/Ice/Instrumentation.rb', line 148

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

Class Method Details

._enumeratorsObject



190
191
192
# File 'lib/Ice/Instrumentation.rb', line 190

def ConnectionState._enumerators
    @@_enumerators
end

.each(&block) ⇒ Object



178
179
180
# File 'lib/Ice/Instrumentation.rb', line 178

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

.from_int(val) ⇒ Object



153
154
155
# File 'lib/Ice/Instrumentation.rb', line 153

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

Instance Method Details

#<=>(other) ⇒ Object



165
166
167
168
# File 'lib/Ice/Instrumentation.rb', line 165

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

#hashObject



170
171
172
# File 'lib/Ice/Instrumentation.rb', line 170

def hash
    @value.hash
end

#inspectObject



174
175
176
# File 'lib/Ice/Instrumentation.rb', line 174

def inspect
    @name + "(#{@value})"
end

#to_iObject



161
162
163
# File 'lib/Ice/Instrumentation.rb', line 161

def to_i
    @value
end

#to_sObject



157
158
159
# File 'lib/Ice/Instrumentation.rb', line 157

def to_s
    @name
end