Class: IceGrid::ServerState
- Inherits:
-
Object
- Object
- IceGrid::ServerState
- Includes:
- Comparable
- Defined in:
- lib/IceGrid/Admin.rb
Constant Summary collapse
- Inactive =
ServerState.new("Inactive", 0)
- Activating =
ServerState.new("Activating", 1)
- ActivationTimedOut =
ServerState.new("ActivationTimedOut", 2)
- Active =
ServerState.new("Active", 3)
- Deactivating =
ServerState.new("Deactivating", 4)
- Destroying =
ServerState.new("Destroying", 5)
- Destroyed =
ServerState.new("Destroyed", 6)
- @@_enumerators =
{0=>Inactive, 1=>Activating, 2=>ActivationTimedOut, 3=>Active, 4=>Deactivating, 5=>Destroying, 6=>Destroyed}
Class Method Summary collapse
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #hash ⇒ Object
-
#initialize(name, value) ⇒ ServerState
constructor
A new instance of ServerState.
- #to_i ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(name, value) ⇒ ServerState
Returns a new instance of ServerState.
32 33 34 35 |
# File 'lib/IceGrid/Admin.rb', line 32 def initialize(name, value) @name = name @value = value end |
Class Method Details
._enumerators ⇒ Object
72 73 74 |
# File 'lib/IceGrid/Admin.rb', line 72 def ServerState._enumerators @@_enumerators end |
.each(&block) ⇒ Object
58 59 60 |
# File 'lib/IceGrid/Admin.rb', line 58 def ServerState.each(&block) @@_enumerators.each_value(&block) end |
.from_int(val) ⇒ Object
37 38 39 |
# File 'lib/IceGrid/Admin.rb', line 37 def ServerState.from_int(val) @@_enumerators[val] end |
Instance Method Details
#<=>(other) ⇒ Object
49 50 51 52 |
# File 'lib/IceGrid/Admin.rb', line 49 def <=>(other) other.is_a?(ServerState) or raise ArgumentError, "value must be a ServerState" @value <=> other.to_i end |
#hash ⇒ Object
54 55 56 |
# File 'lib/IceGrid/Admin.rb', line 54 def hash @value.hash end |
#to_i ⇒ Object
45 46 47 |
# File 'lib/IceGrid/Admin.rb', line 45 def to_i @value end |
#to_s ⇒ Object
41 42 43 |
# File 'lib/IceGrid/Admin.rb', line 41 def to_s @name end |