Class: IceGrid::ServerState
- Inherits:
-
Object
- Object
- IceGrid::ServerState
- Includes:
- Comparable
- Defined in:
- ruby/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.
20 21 22 23 |
# File 'ruby/IceGrid/Admin.rb', line 20 def initialize(name, value) @name = name @value = value end |
Class Method Details
._enumerators ⇒ Object
60 61 62 |
# File 'ruby/IceGrid/Admin.rb', line 60 def ServerState._enumerators @@_enumerators end |
.each(&block) ⇒ Object
46 47 48 |
# File 'ruby/IceGrid/Admin.rb', line 46 def ServerState.each(&block) @@_enumerators.each_value(&block) end |
.from_int(val) ⇒ Object
25 26 27 |
# File 'ruby/IceGrid/Admin.rb', line 25 def ServerState.from_int(val) @@_enumerators[val] end |
Instance Method Details
#<=>(other) ⇒ Object
37 38 39 40 |
# File 'ruby/IceGrid/Admin.rb', line 37 def <=>(other) other.is_a?(ServerState) or raise ArgumentError, "value must be a ServerState" @value <=> other.to_i end |
#hash ⇒ Object
42 43 44 |
# File 'ruby/IceGrid/Admin.rb', line 42 def hash @value.hash end |
#to_i ⇒ Object
33 34 35 |
# File 'ruby/IceGrid/Admin.rb', line 33 def to_i @value end |
#to_s ⇒ Object
29 30 31 |
# File 'ruby/IceGrid/Admin.rb', line 29 def to_s @name end |