Class: Rack::RPC::ProcCommand

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

Instance Attribute Summary

Attributes inherited from Command

#options

Instance Method Summary collapse

Methods inherited from Command

#callable?

Constructor Details

#initialize(proc, options) ⇒ ProcCommand

Returns a new instance of ProcCommand.



93
94
95
96
# File 'lib/rack/rpc/server.rb', line 93

def initialize(proc, options)
  @proc = proc.to_proc
  super(options)
end

Instance Method Details

#call(server) ⇒ Object



98
99
100
# File 'lib/rack/rpc/server.rb', line 98

def call(server)
  server.instance_eval(&@proc)
end