Class: Ice::OperationMode
- Inherits:
-
Object
- Object
- Ice::OperationMode
- Includes:
- Comparable
- Defined in:
- ruby/Ice/OperationMode.rb
Constant Summary collapse
- Normal =
OperationMode.new("Normal", 0)
- Nonmutating =
OperationMode.new("Nonmutating", 1)
- Idempotent =
OperationMode.new("Idempotent", 2)
- @@_enumerators =
{0=>Normal, 1=>Nonmutating, 2=>Idempotent}
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #hash ⇒ Object
-
#initialize(name, value) ⇒ OperationMode
constructor
A new instance of OperationMode.
- #to_i ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(name, value) ⇒ OperationMode
Returns a new instance of OperationMode.
13 14 15 16 |
# File 'ruby/Ice/OperationMode.rb', line 13 def initialize(name, value) @name = name @value = value end |
Instance Method Details
#<=>(other) ⇒ Object
30 31 32 33 |
# File 'ruby/Ice/OperationMode.rb', line 30 def <=>(other) other.is_a?(OperationMode) or raise ArgumentError, "value must be an OperationMode" @value <=> other.to_i end |
#hash ⇒ Object
35 36 37 |
# File 'ruby/Ice/OperationMode.rb', line 35 def hash @value.hash end |
#to_i ⇒ Object
26 27 28 |
# File 'ruby/Ice/OperationMode.rb', line 26 def to_i @value end |
#to_s ⇒ Object
22 23 24 |
# File 'ruby/Ice/OperationMode.rb', line 22 def to_s @name end |