Class: ThriftServer::RPC

Inherits:
Struct
  • Object
show all
Defined in:
lib/thrift_server.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeRPC

Returns a new instance of RPC.



24
25
26
27
# File 'lib/thrift_server.rb', line 24

def initialize(*)
  super
  self.exceptions ||= { }
end

Instance Attribute Details

#argsObject

Returns the value of attribute args

Returns:

  • (Object)

    the current value of args



23
24
25
# File 'lib/thrift_server.rb', line 23

def args
  @args
end

#exceptionsObject

Returns the value of attribute exceptions

Returns:

  • (Object)

    the current value of exceptions



23
24
25
# File 'lib/thrift_server.rb', line 23

def exceptions
  @exceptions
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



23
24
25
# File 'lib/thrift_server.rb', line 23

def name
  @name
end

Instance Method Details

#exception_name(ex) ⇒ Object



33
34
35
# File 'lib/thrift_server.rb', line 33

def exception_name(ex)
  exceptions.invert.fetch ex.class
end

#protocol_exception?(ex) ⇒ Boolean

Returns:

  • (Boolean)


29
30
31
# File 'lib/thrift_server.rb', line 29

def protocol_exception?(ex)
  exceptions.values.include? ex.class
end

#to_sObject



37
38
39
# File 'lib/thrift_server.rb', line 37

def to_s
  name.to_s
end