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.
- #to_i ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(name, value) ⇒ ThreadState
Returns a new instance of ThreadState.
34 35 36 37 |
# File 'lib/Ice/Instrumentation.rb', line 34 def initialize(name, value) @name = name @value = value end |
Class Method Details
._enumerators ⇒ Object
71 72 73 |
# File 'lib/Ice/Instrumentation.rb', line 71 def ThreadState._enumerators @@_enumerators end |
.each(&block) ⇒ Object
60 61 62 |
# File 'lib/Ice/Instrumentation.rb', line 60 def ThreadState.each(&block) @@_enumerators.each_value(&block) end |
.from_int(val) ⇒ Object
39 40 41 |
# File 'lib/Ice/Instrumentation.rb', line 39 def ThreadState.from_int(val) @@_enumerators[val] end |
Instance Method Details
#<=>(other) ⇒ Object
51 52 53 54 |
# File 'lib/Ice/Instrumentation.rb', line 51 def <=>(other) other.is_a?(ThreadState) or raise ArgumentError, "value must be a ThreadState" @value <=> other.to_i end |
#hash ⇒ Object
56 57 58 |
# File 'lib/Ice/Instrumentation.rb', line 56 def hash @value.hash end |
#to_i ⇒ Object
47 48 49 |
# File 'lib/Ice/Instrumentation.rb', line 47 def to_i @value end |
#to_s ⇒ Object
43 44 45 |
# File 'lib/Ice/Instrumentation.rb', line 43 def to_s @name end |