aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2010-07-25 18:12:20 -0300
committerJosé Valim <jose.valim@gmail.com>2010-07-25 23:30:27 +0200
commitb0b9bf320409b66c6c6b680371aca590297cd4cc (patch)
tree4bb7ad3854fb5aacba070c0ddc5f5e4ebd77a551 /activesupport/lib/active_support/core_ext
parentf4200b0cd5c21d7bd37a9b5c9effc2006485ed46 (diff)
downloadrails-b0b9bf320409b66c6c6b680371aca590297cd4cc.tar.gz
rails-b0b9bf320409b66c6c6b680371aca590297cd4cc.tar.bz2
rails-b0b9bf320409b66c6c6b680371aca590297cd4cc.zip
Object#returning removed
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'activesupport/lib/active_support/core_ext')
-rw-r--r--activesupport/lib/active_support/core_ext/object.rb2
-rw-r--r--activesupport/lib/active_support/core_ext/object/misc.rb2
-rw-r--r--activesupport/lib/active_support/core_ext/object/returning.rb42
3 files changed, 0 insertions, 46 deletions
diff --git a/activesupport/lib/active_support/core_ext/object.rb b/activesupport/lib/active_support/core_ext/object.rb
index 27618b55c6..790a26f5c1 100644
--- a/activesupport/lib/active_support/core_ext/object.rb
+++ b/activesupport/lib/active_support/core_ext/object.rb
@@ -5,9 +5,7 @@ require 'active_support/core_ext/object/try'
require 'active_support/core_ext/object/conversions'
require 'active_support/core_ext/object/instance_variables'
-require 'active_support/core_ext/object/misc'
-require 'active_support/core_ext/object/returning'
require 'active_support/core_ext/object/to_json'
require 'active_support/core_ext/object/to_param'
require 'active_support/core_ext/object/to_query'
diff --git a/activesupport/lib/active_support/core_ext/object/misc.rb b/activesupport/lib/active_support/core_ext/object/misc.rb
deleted file mode 100644
index 3e3af03cc5..0000000000
--- a/activesupport/lib/active_support/core_ext/object/misc.rb
+++ /dev/null
@@ -1,2 +0,0 @@
-require 'active_support/core_ext/object/returning'
-require 'active_support/core_ext/object/with_options'
diff --git a/activesupport/lib/active_support/core_ext/object/returning.rb b/activesupport/lib/active_support/core_ext/object/returning.rb
deleted file mode 100644
index 0dc2e1266a..0000000000
--- a/activesupport/lib/active_support/core_ext/object/returning.rb
+++ /dev/null
@@ -1,42 +0,0 @@
-class Object
- # Returns +value+ after yielding +value+ to the block. This simplifies the
- # process of constructing an object, performing work on the object, and then
- # returning the object from a method. It is a Ruby-ized realization of the K
- # combinator, courtesy of Mikael Brockman.
- #
- # ==== Examples
- #
- # # Without returning
- # def foo
- # values = []
- # values << "bar"
- # values << "baz"
- # return values
- # end
- #
- # foo # => ['bar', 'baz']
- #
- # # returning with a local variable
- # def foo
- # returning values = [] do
- # values << 'bar'
- # values << 'baz'
- # end
- # end
- #
- # foo # => ['bar', 'baz']
- #
- # # returning with a block argument
- # def foo
- # returning [] do |values|
- # values << 'bar'
- # values << 'baz'
- # end
- # end
- #
- # foo # => ['bar', 'baz']
- def returning(value)
- yield(value)
- value
- end
-end