diff options
author | Sam Stephenson <sam@37signals.com> | 2005-12-15 20:03:23 +0000 |
---|---|---|
committer | Sam Stephenson <sam@37signals.com> | 2005-12-15 20:03:23 +0000 |
commit | 85fe1ecaefe415ac1de36883f5f6162f49bd5287 (patch) | |
tree | 34f87cac51f7009928bc6ba0604cddf62be01d3e /activesupport/lib/active_support/core_ext | |
parent | fc4ffbdc69988b60bd17ffab5d8d81ec67a11180 (diff) | |
download | rails-85fe1ecaefe415ac1de36883f5f6162f49bd5287.tar.gz rails-85fe1ecaefe415ac1de36883f5f6162f49bd5287.tar.bz2 rails-85fe1ecaefe415ac1de36883f5f6162f49bd5287.zip |
Add Object#with_options for DRYing up multiple calls to methods having shared options
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3314 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/lib/active_support/core_ext')
-rw-r--r-- | activesupport/lib/active_support/core_ext/object_and_class.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/core_ext/object_and_class.rb b/activesupport/lib/active_support/core_ext/object_and_class.rb index 7864c1a9dc..aef1f22c6f 100644 --- a/activesupport/lib/active_support/core_ext/object_and_class.rb +++ b/activesupport/lib/active_support/core_ext/object_and_class.rb @@ -50,6 +50,10 @@ class Object #:nodoc: raise unless exception_classes.any? {|cls| e.kind_of? cls} end end + + def with_options(options) + yield ActiveSupport::OptionMerger.new(self, options) + end end class Class #:nodoc: |