Class: Ice::ReplyStatus

Inherits:
Object
  • Object
show all
Includes:
Comparable
Defined in:
ruby/Ice/ReplyStatus.rb

Constant Summary collapse

Ok =
ReplyStatus.new("Ok", 0)
UserException =
ReplyStatus.new("UserException", 1)
ObjectNotExist =
ReplyStatus.new("ObjectNotExist", 2)
FacetNotExist =
ReplyStatus.new("FacetNotExist", 3)
OperationNotExist =
ReplyStatus.new("OperationNotExist", 4)
UnknownLocalException =
ReplyStatus.new("UnknownLocalException", 5)
UnknownUserException =
ReplyStatus.new("UnknownUserException", 6)
UnknownException =
ReplyStatus.new("UnknownException", 7)
InvalidData =
ReplyStatus.new("InvalidData", 8)
Unauthorized =
ReplyStatus.new("Unauthorized", 9)
@@_enumerators =
{0=>Ok, 1=>UserException, 2=>ObjectNotExist, 3=>FacetNotExist, 4=>OperationNotExist, 5=>UnknownLocalException, 6=>UnknownUserException, 7=>UnknownException, 8=>InvalidData, 9=>Unauthorized}

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, value) ⇒ ReplyStatus

Returns a new instance of ReplyStatus.



13
14
15
16
# File 'ruby/Ice/ReplyStatus.rb', line 13

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

Class Method Details

._enumeratorsObject



56
57
58
# File 'ruby/Ice/ReplyStatus.rb', line 56

def ReplyStatus._enumerators
    @@_enumerators
end

.each(&block) ⇒ Object



39
40
41
# File 'ruby/Ice/ReplyStatus.rb', line 39

def ReplyStatus.each(&block)
    @@_enumerators.each_value(&block)
end

.from_int(val) ⇒ Object



18
19
20
# File 'ruby/Ice/ReplyStatus.rb', line 18

def ReplyStatus.from_int(val)
    @@_enumerators[val]
end

Instance Method Details

#<=>(other) ⇒ Object



30
31
32
33
# File 'ruby/Ice/ReplyStatus.rb', line 30

def <=>(other)
    other.is_a?(ReplyStatus) or raise ArgumentError, "value must be a ReplyStatus"
    @value <=> other.to_i
end

#hashObject



35
36
37
# File 'ruby/Ice/ReplyStatus.rb', line 35

def hash
    @value.hash
end

#to_iObject



26
27
28
# File 'ruby/Ice/ReplyStatus.rb', line 26

def to_i
    @value
end

#to_sObject



22
23
24
# File 'ruby/Ice/ReplyStatus.rb', line 22

def to_s
    @name
end