Module: RPC

Defined in:
lib/rpc/lib/rpc/clients/em-http-request.rb,
lib/rpc/lib/rpc.rb,
lib/rpc/lib/rpc/encoders/json.rb,
lib/rpc/lib/rpc/clients/socket.rb,
lib/rpc/lib/rpc/clients/net-http.rb

Overview

Note that we support only HTTP POST. JSON-RPC can be done via HTTP GET as well, but since HTTP POST is the preferred method, I decided to implement only it. More info can is here: groups.google.com/group/json-rpc/web/json-rpc-over-http

Defined Under Namespace

Modules: Clients, Encoders, ExceptionsMixin Classes: Client, Server

Class Method Summary collapse

Class Method Details

.development=(boolean) ⇒ Object



26
27
28
# File 'lib/rpc/lib/rpc.rb', line 26

def self.development=(boolean)
  @development = boolean
end

.development?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/rpc/lib/rpc.rb', line 30

def self.development?
  !! @development
end

.full_const_get(const_name) ⇒ Object



34
35
36
37
38
39
# File 'lib/rpc/lib/rpc.rb', line 34

def self.full_const_get(const_name)
  parts = const_name.sub(/^::/, "").split("::")
  parts.reduce(Object) do |constant, part|
    constant.const_get(part)
  end
end

.log(message) ⇒ Object



22
23
24
# File 'lib/rpc/lib/rpc.rb', line 22

def self.log(message)
  STDERR.puts(message) if self.logging
end

.loggingObject



14
15
16
# File 'lib/rpc/lib/rpc.rb', line 14

def self.logging
  @logging ||= $DEBUG
end

.logging=(boolean) ⇒ Object



18
19
20
# File 'lib/rpc/lib/rpc.rb', line 18

def self.logging=(boolean)
  @logging = boolean
end