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}
Class Method Summary collapse
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 |
Class Method Details
._enumerators ⇒ Object
49 50 51 |
# File 'ruby/Ice/OperationMode.rb', line 49 def OperationMode._enumerators @@_enumerators end |
.each(&block) ⇒ Object
39 40 41 |
# File 'ruby/Ice/OperationMode.rb', line 39 def OperationMode.each(&block) @@_enumerators.each_value(&block) end |
.from_int(val) ⇒ Object
18 19 20 |
# File 'ruby/Ice/OperationMode.rb', line 18 def OperationMode.from_int(val) @@_enumerators[val] 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 |