From 2cf72ad250f7c393e6aa97384768ed803686eb97 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Mon, 31 Mar 2008 01:09:39 +0000 Subject: Add query methods for superclass_delegating_reader git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9156 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- .../lib/active_support/core_ext/class/delegating_attributes.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'activesupport/lib/active_support/core_ext') diff --git a/activesupport/lib/active_support/core_ext/class/delegating_attributes.rb b/activesupport/lib/active_support/core_ext/class/delegating_attributes.rb index f5f0ef8779..368317df9b 100644 --- a/activesupport/lib/active_support/core_ext/class/delegating_attributes.rb +++ b/activesupport/lib/active_support/core_ext/class/delegating_attributes.rb @@ -19,6 +19,12 @@ class Class def #{name} self.class.#{name} end + def self.#{name}? + !!#{name} + end + def #{name}? + !!#{name} + end EOS end end @@ -37,4 +43,4 @@ class Class superclass_delegating_reader(*names) superclass_delegating_writer(*names) end -end \ No newline at end of file +end -- cgit v1.2.3