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}
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 |
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 |