Class: IceGrid::LoadSample
- Inherits:
-
Object
- Object
- IceGrid::LoadSample
- Includes:
- Comparable
- Defined in:
- ruby/IceGrid/Registry.rb
Constant Summary collapse
- LoadSample1 =
LoadSample.new("LoadSample1", 0)
- LoadSample5 =
LoadSample.new("LoadSample5", 1)
- LoadSample15 =
LoadSample.new("LoadSample15", 2)
- @@_enumerators =
{0=>LoadSample1, 1=>LoadSample5, 2=>LoadSample15}
Class Method Summary collapse
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #hash ⇒ Object
-
#initialize(name, value) ⇒ LoadSample
constructor
A new instance of LoadSample.
- #to_i ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(name, value) ⇒ LoadSample
Returns a new instance of LoadSample.
16 17 18 19 |
# File 'ruby/IceGrid/Registry.rb', line 16 def initialize(name, value) @name = name @value = value end |
Class Method Details
._enumerators ⇒ Object
52 53 54 |
# File 'ruby/IceGrid/Registry.rb', line 52 def LoadSample._enumerators @@_enumerators end |
.each(&block) ⇒ Object
42 43 44 |
# File 'ruby/IceGrid/Registry.rb', line 42 def LoadSample.each(&block) @@_enumerators.each_value(&block) end |
.from_int(val) ⇒ Object
21 22 23 |
# File 'ruby/IceGrid/Registry.rb', line 21 def LoadSample.from_int(val) @@_enumerators[val] end |
Instance Method Details
#<=>(other) ⇒ Object
33 34 35 36 |
# File 'ruby/IceGrid/Registry.rb', line 33 def <=>(other) other.is_a?(LoadSample) or raise ArgumentError, "value must be a LoadSample" @value <=> other.to_i end |
#hash ⇒ Object
38 39 40 |
# File 'ruby/IceGrid/Registry.rb', line 38 def hash @value.hash end |
#to_i ⇒ Object
29 30 31 |
# File 'ruby/IceGrid/Registry.rb', line 29 def to_i @value end |
#to_s ⇒ Object
25 26 27 |
# File 'ruby/IceGrid/Registry.rb', line 25 def to_s @name end |