Class: JsonRpc2Rest

Inherits:
Object
  • Object
show all
Defined in:
lib/json-rpc2rest.rb

Instance Method Summary collapse

Constructor Details

#initialize(app, options = {}) ⇒ JsonRpc2Rest



5
6
7
8
# File 'lib/json-rpc2rest.rb', line 5

def initialize(app, options={})
  @app = app
  @field = options[:field] || 'method'
end

Instance Method Details

#call(env) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/json-rpc2rest.rb', line 10

def call(env)
  init_call(env)

  change_path(new_path) if json_rpc_present?

  @app.call(env)
end