diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-06-06 08:49:38 -0700 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-06-06 08:49:38 -0700 |
commit | b4fb80cbdab118125df0d48e74b6818fe5ec65d5 (patch) | |
tree | b912b5041ee4a6a1ea7fdb3a743a7205b6bbd579 /actionpack/lib/abstract_controller/collector.rb | |
parent | 96123978ff5cbfe1ce56c2a3203b02007823335b (diff) | |
parent | ef9bbb87e8228940f768580a7d05d5feadec0d1e (diff) | |
download | rails-b4fb80cbdab118125df0d48e74b6818fe5ec65d5.tar.gz rails-b4fb80cbdab118125df0d48e74b6818fe5ec65d5.tar.bz2 rails-b4fb80cbdab118125df0d48e74b6818fe5ec65d5.zip |
Merge pull request #6645 from amatsuda/reduce_string_instance
Reduce number of String instance
Diffstat (limited to 'actionpack/lib/abstract_controller/collector.rb')
-rw-r--r-- | actionpack/lib/abstract_controller/collector.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/actionpack/lib/abstract_controller/collector.rb b/actionpack/lib/abstract_controller/collector.rb index 81fb514770..492329c401 100644 --- a/actionpack/lib/abstract_controller/collector.rb +++ b/actionpack/lib/abstract_controller/collector.rb @@ -4,7 +4,7 @@ module AbstractController module Collector def self.generate_method_for_mime(mime) sym = mime.is_a?(Symbol) ? mime : mime.to_sym - const = sym.to_s.upcase + const = sym.upcase class_eval <<-RUBY, __FILE__, __LINE__ + 1 def #{sym}(*args, &block) # def html(*args, &block) custom(Mime::#{const}, *args, &block) # custom(Mime::HTML, *args, &block) @@ -19,7 +19,7 @@ module AbstractController protected def method_missing(symbol, &block) - mime_constant = Mime.const_get(symbol.to_s.upcase) + mime_constant = Mime.const_get(symbol.upcase) if Mime::SET.include?(mime_constant) AbstractController::Collector.generate_method_for_mime(mime_constant) @@ -29,4 +29,4 @@ module AbstractController end end end -end
\ No newline at end of file +end |