Class: Ice::CompressBatch
- Inherits:
-
Object
- Object
- Ice::CompressBatch
- Includes:
- Comparable
- Defined in:
- lib/Ice/Connection.rb
Constant Summary collapse
- Yes =
CompressBatch.new("Yes", 0)
- No =
CompressBatch.new("No", 1)
- BasedOnProxy =
CompressBatch.new("BasedOnProxy", 2)
- @@_enumerators =
{0=>Yes, 1=>No, 2=>BasedOnProxy}
Class Method Summary collapse
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #hash ⇒ Object
-
#initialize(name, value) ⇒ CompressBatch
constructor
A new instance of CompressBatch.
- #to_i ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(name, value) ⇒ CompressBatch
Returns a new instance of CompressBatch.
28 29 30 31 |
# File 'lib/Ice/Connection.rb', line 28 def initialize(name, value) @name = name @value = value end |
Class Method Details
._enumerators ⇒ Object
64 65 66 |
# File 'lib/Ice/Connection.rb', line 64 def CompressBatch._enumerators @@_enumerators end |
.each(&block) ⇒ Object
54 55 56 |
# File 'lib/Ice/Connection.rb', line 54 def CompressBatch.each(&block) @@_enumerators.each_value(&block) end |
.from_int(val) ⇒ Object
33 34 35 |
# File 'lib/Ice/Connection.rb', line 33 def CompressBatch.from_int(val) @@_enumerators[val] end |
Instance Method Details
#<=>(other) ⇒ Object
45 46 47 48 |
# File 'lib/Ice/Connection.rb', line 45 def <=>(other) other.is_a?(CompressBatch) or raise ArgumentError, "value must be a CompressBatch" @value <=> other.to_i end |
#hash ⇒ Object
50 51 52 |
# File 'lib/Ice/Connection.rb', line 50 def hash @value.hash end |
#to_i ⇒ Object
41 42 43 |
# File 'lib/Ice/Connection.rb', line 41 def to_i @value end |
#to_s ⇒ Object
37 38 39 |
# File 'lib/Ice/Connection.rb', line 37 def to_s @name end |