Class: IceGrid::LoadSample

Inherits:
Object
  • Object
show all
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

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

._enumeratorsObject



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

#hashObject



38
39
40
# File 'ruby/IceGrid/Registry.rb', line 38

def hash
    @value.hash
end

#to_iObject



29
30
31
# File 'ruby/IceGrid/Registry.rb', line 29

def to_i
    @value
end

#to_sObject



25
26
27
# File 'ruby/IceGrid/Registry.rb', line 25

def to_s
    @name
end