Class: Ice::Instrumentation::ThreadState
- Inherits:
-
Object
- Object
- Ice::Instrumentation::ThreadState
- Includes:
- Comparable
- Defined in:
- lib/Ice/Instrumentation.rb
Constant Summary collapse
- ThreadStateIdle =
ThreadState.new("ThreadStateIdle", 0)
- ThreadStateInUseForIO =
ThreadState.new("ThreadStateInUseForIO", 1)
- ThreadStateInUseForUser =
ThreadState.new("ThreadStateInUseForUser", 2)
- ThreadStateInUseForOther =
ThreadState.new("ThreadStateInUseForOther", 3)
- @@_enumerators =
{0=>ThreadStateIdle, 1=>ThreadStateInUseForIO, 2=>ThreadStateInUseForUser, 3=>ThreadStateInUseForOther}
Class Method Summary collapse
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #hash ⇒ Object
-
#initialize(name, value) ⇒ ThreadState
constructor
A new instance of ThreadState.
- #inspect ⇒ Object
- #to_i ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(name, value) ⇒ ThreadState
Returns a new instance of ThreadState.
65 66 67 68 |
# File 'lib/Ice/Instrumentation.rb', line 65 def initialize(name, value) @name = name @value = value end |
Class Method Details
._enumerators ⇒ Object
106 107 108 |
# File 'lib/Ice/Instrumentation.rb', line 106 def ThreadState._enumerators @@_enumerators end |
.each(&block) ⇒ Object
95 96 97 |
# File 'lib/Ice/Instrumentation.rb', line 95 def ThreadState.each(&block) @@_enumerators.each_value(&block) end |
.from_int(val) ⇒ Object
70 71 72 |
# File 'lib/Ice/Instrumentation.rb', line 70 def ThreadState.from_int(val) @@_enumerators[val] end |
Instance Method Details
#<=>(other) ⇒ Object
82 83 84 85 |
# File 'lib/Ice/Instrumentation.rb', line 82 def <=>(other) other.is_a?(ThreadState) or raise ArgumentError, "value must be a ThreadState" @value <=> other.to_i end |
#hash ⇒ Object
87 88 89 |
# File 'lib/Ice/Instrumentation.rb', line 87 def hash @value.hash end |
#inspect ⇒ Object
91 92 93 |
# File 'lib/Ice/Instrumentation.rb', line 91 def inspect @name + "(#{@value})" end |
#to_i ⇒ Object
78 79 80 |
# File 'lib/Ice/Instrumentation.rb', line 78 def to_i @value end |
#to_s ⇒ Object
74 75 76 |
# File 'lib/Ice/Instrumentation.rb', line 74 def to_s @name end |