Class: Rack::RPC::Server
- Inherits:
-
Object
- Object
- Rack::RPC::Server
- Defined in:
- lib/rack/rpc/server.rb
Overview
A base class for RPC servers.
Instance Attribute Summary (collapse)
Class Method Summary (collapse)
- + (void) after_filter(method_sym = nil, options = {}, &block)
- + (void) before_filter(method_sym = nil, options = {}, &block)
- + (void) hooks
Instance Method Summary (collapse)
-
- (Server) initialize(options = {}, &block)
constructor
A new instance of Server.
Constructor Details
- (Server) initialize(options = {}, &block)
Returns a new instance of Server
56 57 58 59 |
# File 'lib/rack/rpc/server.rb', line 56 def initialize( = {}, &block) @options = .dup block.call(self) if block_given? end |
Instance Attribute Details
- (Hash) options (readonly)
49 50 51 |
# File 'lib/rack/rpc/server.rb', line 49 def @options end |
- (Rack::Request) 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, = {}, &block) setup_hook(:after, method_sym, , 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, = {}, &block) setup_hook(:before, method_sym, , block) end |
+ (void) hooks
36 37 38 |
# File 'lib/rack/rpc/server.rb', line 36 def self.hooks @hooks ||= {:before => [], :after => []} end |