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

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

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