Class: Rack::RPC::Server

Inherits:
Object
  • Object
show all
Defined in:
lib/rack/rpc/server.rb

Overview

A base class for RPC servers.

Instance Attribute Summary (collapse)

Class Method Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (Server) initialize(options = {}, &block)

Returns a new instance of Server

Parameters:

  • options (Hash) (defaults to: {})


56
57
58
59
# File 'lib/rack/rpc/server.rb', line 56

def initialize(options = {}, &block)
  @options = options.dup
  block.call(self) if block_given?
end

Instance Attribute Details

- (Hash) options (readonly)

Returns:

  • (Hash)


49
50
51
# File 'lib/rack/rpc/server.rb', line 49

def options
  @options
end

- (Rack::Request) request

Returns:

  • (Rack::Request)


52
53
54
# File 'lib/rack/rpc/server.rb', line 52

def request
  @request
end

Class Method Details

+ (void) after_filter(method_sym = nil, options = {}, &block)



44
45
46
# File 'lib/rack/rpc/server.rb', line 44

def self.after_filter(method_sym = nil, options = {}, &block)
  setup_hook(:after, method_sym, options, block)
end

+ (void) before_filter(method_sym = nil, options = {}, &block)



40
41
42
# File 'lib/rack/rpc/server.rb', line 40

def self.before_filter(method_sym = nil, options = {}, &block)
  setup_hook(:before, method_sym, options, block)
end

+ (void) hooks



36
37
38
# File 'lib/rack/rpc/server.rb', line 36

def self.hooks
  @hooks ||= {:before => [], :after => []}
end