Class: Ice::EndpointSelectionType
- Inherits:
-
Object
- Object
- Ice::EndpointSelectionType
- Includes:
- Comparable
- Defined in:
- lib/Ice/EndpointTypes.rb
Constant Summary collapse
- Random =
EndpointSelectionType.new("Random", 0)
- Ordered =
EndpointSelectionType.new("Ordered", 1)
- @@_enumerators =
{0=>Random, 1=>Ordered}
Class Method Summary collapse
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #hash ⇒ Object
-
#initialize(name, value) ⇒ EndpointSelectionType
constructor
A new instance of EndpointSelectionType.
- #to_i ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(name, value) ⇒ EndpointSelectionType
Returns a new instance of EndpointSelectionType.
25 26 27 28 |
# File 'lib/Ice/EndpointTypes.rb', line 25 def initialize(name, value) @name = name @value = value end |
Class Method Details
._enumerators ⇒ Object
60 61 62 |
# File 'lib/Ice/EndpointTypes.rb', line 60 def EndpointSelectionType._enumerators @@_enumerators end |
.each(&block) ⇒ Object
51 52 53 |
# File 'lib/Ice/EndpointTypes.rb', line 51 def EndpointSelectionType.each(&block) @@_enumerators.each_value(&block) end |
.from_int(val) ⇒ Object
30 31 32 |
# File 'lib/Ice/EndpointTypes.rb', line 30 def EndpointSelectionType.from_int(val) @@_enumerators[val] end |
Instance Method Details
#<=>(other) ⇒ Object
42 43 44 45 |
# File 'lib/Ice/EndpointTypes.rb', line 42 def <=>(other) other.is_a?(EndpointSelectionType) or raise ArgumentError, "value must be a EndpointSelectionType" @value <=> other.to_i end |
#hash ⇒ Object
47 48 49 |
# File 'lib/Ice/EndpointTypes.rb', line 47 def hash @value.hash end |
#to_i ⇒ Object
38 39 40 |
# File 'lib/Ice/EndpointTypes.rb', line 38 def to_i @value end |
#to_s ⇒ Object
34 35 36 |
# File 'lib/Ice/EndpointTypes.rb', line 34 def to_s @name end |