summaryrefslogtreecommitdiff
path: root/lib/delegate.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-05-19 00:07:25 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-05-19 00:07:25 +0000
commitd371e3583e3b1e0692f92343017b62d2628190ff (patch)
treebe82924ada754f8542f394d0a3d28e0a0b02a098 /lib/delegate.rb
parent1fae66fca28167ca0e25625091c5df49405b8023 (diff)
* lib: revert r31635-r31638 and untabify with expand(1).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31641 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/delegate.rb')
-rw-r--r--lib/delegate.rb20
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/delegate.rb b/lib/delegate.rb
index 8c93ca3ff4b..2004d228c70 100644
--- a/lib/delegate.rb
+++ b/lib/delegate.rb
@@ -330,12 +330,12 @@ end
# :stopdoc:
def Delegator.delegating_block(mid)
lambda do |*args, &block|
- target = self.__getobj__
- begin
- target.__send__(mid, *args, &block)
- ensure
- $@.delete_if {|t| /\A#{Regexp.quote(__FILE__)}:#{__LINE__-2}:/o =~ t} if $@
- end
+ target = self.__getobj__
+ begin
+ target.__send__(mid, *args, &block)
+ ensure
+ $@.delete_if {|t| /\A#{Regexp.quote(__FILE__)}:#{__LINE__-2}:/o =~ t} if $@
+ end
end
end
# :startdoc:
@@ -368,10 +368,10 @@ def DelegateClass(superclass)
end
end
klass.define_singleton_method :public_instance_methods do |all=true|
- super(all) - superclass.protected_instance_methods
+ super(all) - superclass.protected_instance_methods
end
klass.define_singleton_method :protected_instance_methods do |all=true|
- super(all) | superclass.protected_instance_methods
+ super(all) | superclass.protected_instance_methods
end
return klass
end
@@ -405,7 +405,7 @@ if __FILE__ == $0
foo2 = SimpleDelegator.new(foo)
p foo2
foo2.instance_eval{print "foo\n"}
- p foo.test == foo2.test # => true
+ p foo.test == foo2.test # => true
p foo2.iter{[55,true]} # => true
- foo2.error # raise error!
+ foo2.error # raise error!
end