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.
- #inspect ⇒ Object
- #to_i ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(name, value) ⇒ ServerState
Returns a new instance of ServerState.
37 38 39 40 |
# File 'lib/IceGrid/Admin.rb', line 37 def initialize(name, value) @name = name @value = value end |
Class Method Details
._enumerators ⇒ Object
81 82 83 |
# File 'lib/IceGrid/Admin.rb', line 81 def ServerState._enumerators @@_enumerators end |
.each(&block) ⇒ Object
67 68 69 |
# File 'lib/IceGrid/Admin.rb', line 67 def ServerState.each(&block) @@_enumerators.each_value(&block) end |
.from_int(val) ⇒ Object
42 43 44 |
# File 'lib/IceGrid/Admin.rb', line 42 def ServerState.from_int(val) @@_enumerators[val] end |
Instance Method Details
#<=>(other) ⇒ Object
54 55 56 57 |
# File 'lib/IceGrid/Admin.rb', line 54 def <=>(other) other.is_a?(ServerState) or raise ArgumentError, "value must be a ServerState" @value <=> other.to_i end |
#hash ⇒ Object
59 60 61 |
# File 'lib/IceGrid/Admin.rb', line 59 def hash @value.hash end |
#inspect ⇒ Object
63 64 65 |
# File 'lib/IceGrid/Admin.rb', line 63 def inspect @name + "(#{@value})" end |
#to_i ⇒ Object
50 51 52 |
# File 'lib/IceGrid/Admin.rb', line 50 def to_i @value end |
#to_s ⇒ Object
46 47 48 |
# File 'lib/IceGrid/Admin.rb', line 46 def to_s @name end |