aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib/action_view/template/types.rb
diff options
context:
space:
mode:
authorKasper Timm Hansen <kaspth@gmail.com>2016-01-17 15:31:09 +0100
committerKasper Timm Hansen <kaspth@gmail.com>2016-01-17 16:31:12 +0100
commitbb295be314e7c6d2c26b370209e29eba4b4553c8 (patch)
tree97fdf224b0e74989ddef8be9d876cad348562736 /actionview/lib/action_view/template/types.rb
parentf48098bd80cb93fcc670f2d0a016a64171dfad65 (diff)
downloadrails-bb295be314e7c6d2c26b370209e29eba4b4553c8.tar.gz
rails-bb295be314e7c6d2c26b370209e29eba4b4553c8.tar.bz2
rails-bb295be314e7c6d2c26b370209e29eba4b4553c8.zip
Replace delegate calls with standard method defs.
Spares a to_sym call by aliasing to_sym to ref. Then the delegate felt meager for one method; ditch and define method ourselves.
Diffstat (limited to 'actionview/lib/action_view/template/types.rb')
-rw-r--r--actionview/lib/action_view/template/types.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/actionview/lib/action_view/template/types.rb b/actionview/lib/action_view/template/types.rb
index 2bd8bcee02..8ba5a48aef 100644
--- a/actionview/lib/action_view/template/types.rb
+++ b/actionview/lib/action_view/template/types.rb
@@ -28,12 +28,15 @@ module ActionView
@symbol = symbol.to_sym
end
- delegate :to_s, :to_sym, :to => :symbol
+ def to_s
+ @symbol.to_s
+ end
alias to_str to_s
def ref
@symbol
end
+ alias to_sym ref
def ==(type)
@symbol == type.to_sym unless type.blank?