Class: Ice::CompressBatch

Inherits:
Object
  • Object
show all
Includes:
Comparable
Defined in:
ruby/Ice/CompressBatch.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}

Instance Method Summary collapse

Constructor Details

#initialize(name, value) ⇒ CompressBatch

Returns a new instance of CompressBatch.



8
9
10
11
# File 'ruby/Ice/CompressBatch.rb', line 8

def initialize(name, value)
    @name = name
    @value = value
end

Instance Method Details

#<=>(other) ⇒ Object



25
26
27
# File 'ruby/Ice/CompressBatch.rb', line 25

def <=>(other)
    @value <=> other.to_i if other.is_a?(CompressBatch)
end

#hashObject



29
30
31
# File 'ruby/Ice/CompressBatch.rb', line 29

def hash
    @value.hash
end

#to_iObject



21
22
23
# File 'ruby/Ice/CompressBatch.rb', line 21

def to_i
    @value
end

#to_sObject



17
18
19
# File 'ruby/Ice/CompressBatch.rb', line 17

def to_s
    @name
end