module Roda::RodaPlugins::Delegate::ClassMethods

  1. lib/roda/plugins/delegate.rb

Public Instance methods

class_delegate(*meths)

Delegate the given methods to the class

[show source]
   # File lib/roda/plugins/delegate.rb
53 def class_delegate(*meths)
54   meths.each do |meth|
55     define_method(meth){|*a, &block| self.class.public_send(meth, *a, &block)}
56   end
57 end
request_delegate(*meths)

Delegate the given methods to the request

[show source]
   # File lib/roda/plugins/delegate.rb
60 def request_delegate(*meths)
61   meths.each do |meth|
62     define_method(meth){|*a, &block| @_request.public_send(meth, *a, &block)}
63   end
64 end
response_delegate(*meths)

Delegate the given methods to the response

[show source]
   # File lib/roda/plugins/delegate.rb
67 def response_delegate(*meths)
68   meths.each do |meth|
69     define_method(meth){|*a, &block| @_response.public_send(meth, *a, &block)}
70   end
71 end