aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/metal
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2010-08-19 15:15:46 -0300
committerJosé Valim <jose.valim@gmail.com>2010-08-19 15:16:11 -0300
commitde0f47afb26703d6d4aefdeb7f76b8d3e0fe134d (patch)
treeafc863ab3beb4358b747bcf0c074ae62936115e5 /actionpack/lib/action_controller/metal
parentc019db8ca1c5639fdae80915cc7520eaad7dcd65 (diff)
downloadrails-de0f47afb26703d6d4aefdeb7f76b8d3e0fe134d.tar.gz
rails-de0f47afb26703d6d4aefdeb7f76b8d3e0fe134d.tar.bz2
rails-de0f47afb26703d6d4aefdeb7f76b8d3e0fe134d.zip
Use attribute readers as they are faster in general.
Diffstat (limited to 'actionpack/lib/action_controller/metal')
-rw-r--r--actionpack/lib/action_controller/metal/responder.rb10
1 files changed, 2 insertions, 8 deletions
diff --git a/actionpack/lib/action_controller/metal/responder.rb b/actionpack/lib/action_controller/metal/responder.rb
index cb644dfd16..aafba2a65f 100644
--- a/actionpack/lib/action_controller/metal/responder.rb
+++ b/actionpack/lib/action_controller/metal/responder.rb
@@ -89,6 +89,8 @@ module ActionController #:nodoc:
def initialize(controller, resources, options={})
@controller = controller
+ @request = @controller.request
+ @format = @controller.formats.first
@resource = resources.last
@resources = resources
@options = options
@@ -99,14 +101,6 @@ module ActionController #:nodoc:
delegate :head, :render, :redirect_to, :to => :controller
delegate :get?, :post?, :put?, :delete?, :to => :request
- def request
- @request ||= @controller.request
- end
-
- def format
- @format ||= @controller.formats.first
- end
-
# Undefine :to_json and :to_yaml since it's defined on Object
undef_method(:to_json) if method_defined?(:to_json)
undef_method(:to_yaml) if method_defined?(:to_yaml)