Object#returning removed
Signed-off-by: José Valim <jose.valim@gmail.com>
This commit is contained in:
parent
f4200b0cd5
commit
b0b9bf3204
|
@ -1,4 +1,4 @@
|
|||
require 'active_support/core_ext/object/misc'
|
||||
require 'active_support/core_ext/object/with_options'
|
||||
|
||||
module MyApplication
|
||||
module Business
|
||||
|
|
|
@ -7,7 +7,6 @@ require 'active_support/core_ext/module/attr_accessor_with_default'
|
|||
require 'active_support/core_ext/module/delegation'
|
||||
require 'active_support/core_ext/module/aliasing'
|
||||
require 'active_support/core_ext/object/blank'
|
||||
require 'active_support/core_ext/object/misc'
|
||||
require 'active_support/core_ext/object/to_query'
|
||||
require 'active_support/core_ext/object/duplicable'
|
||||
require 'set'
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -1,2 +0,0 @@
|
|||
require 'active_support/core_ext/object/returning'
|
||||
require 'active_support/core_ext/object/with_options'
|
|
@ -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
|
|
@ -1,5 +1,5 @@
|
|||
require 'abstract_unit'
|
||||
require 'active_support/core_ext/object/misc'
|
||||
require 'active_support/core_ext/object/with_options'
|
||||
|
||||
class OptionMergerTest < Test::Unit::TestCase
|
||||
def setup
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
require "active_support/core_ext/object/misc"
|
||||
require "cgi"
|
||||
require "active_support/core_ext/cgi"
|
||||
|
||||
|
|
Loading…
Reference in New Issue