Permalink
Browse files

Document Actual::Method#to_s

  • Loading branch information...
1 parent d16d932 commit 97a81445768be54ddba71111c3328b1a091faba0 Nikolai Weibull committed May 3, 2012
Showing with 8 additions and 6 deletions.
  1. +8 −6 lib/lookout/actual/method.rb
@@ -17,17 +17,19 @@ def call(actual)
actual.__send__(method, *args, &block)
end
- def to_s
- '#%s%s%s' % [method,
- args.empty? ? '' : '(%s)' % Lookout::Inspect::Argument.list(*args),
- block ? '{ … }' : '']
- end
-
# @return [Expected::Lookout::Actual::Method] An expected value wrapper of
# the receiver
def to_lookout_expected
Lookout::Expected::Lookout::Actual::Method.new(self)
end
+ # @return A string of the form “#_method_(_args_){ … }”, depending on if any
+ # arguments or block has been given
+ def to_s
+ '#%s%s%s' % [method,
+ args.empty? ? '' : '(%s)' % Lookout::Inspect::Argument.list(*args),
+ block ? '{ … }' : '']
+ end
+
alias inspect to_s
end

0 comments on commit 97a8144

Please sign in to comment.