Class: Ice::OperationMode
- Inherits:
-
Object
- Object
- Ice::OperationMode
- Includes:
- Comparable
- Defined in:
- lib/Ice/Current.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
permalink #initialize(name, value) ⇒ OperationMode
Returns a new instance of OperationMode.
33 34 35 36 |
# File 'lib/Ice/Current.rb', line 33 def initialize(name, value) @name = name @value = value end |
Class Method Details
permalink ._enumerators ⇒ Object
[View source]
69 70 71 |
# File 'lib/Ice/Current.rb', line 69 def OperationMode._enumerators @@_enumerators end |
permalink .each(&block) ⇒ Object
[View source]
59 60 61 |
# File 'lib/Ice/Current.rb', line 59 def OperationMode.each(&block) @@_enumerators.each_value(&block) end |
permalink .from_int(val) ⇒ Object
[View source]
38 39 40 |
# File 'lib/Ice/Current.rb', line 38 def OperationMode.from_int(val) @@_enumerators[val] end |
Instance Method Details
permalink #<=>(other) ⇒ Object
[View source]
50 51 52 53 |
# File 'lib/Ice/Current.rb', line 50 def <=>(other) other.is_a?(OperationMode) or raise ArgumentError, "value must be a OperationMode" @value <=> other.to_i end |
permalink #hash ⇒ Object
[View source]
55 56 57 |
# File 'lib/Ice/Current.rb', line 55 def hash @value.hash end |
permalink #to_i ⇒ Object
[View source]
46 47 48 |
# File 'lib/Ice/Current.rb', line 46 def to_i @value end |
permalink #to_s ⇒ Object
[View source]
42 43 44 |
# File 'lib/Ice/Current.rb', line 42 def to_s @name end |