Class: Lookout::Actual::Method
- Defined in:
- lib/lookout-3.0/actual/method.rb
Overview
Proxies a method for later invocation on the actual result. The method information is stored and used when this method is #called, which passes it along to the given actual result.
Direct Known Subclasses
Instance Method Summary collapse
-
#call(actual) ⇒ Object
The result of invoking the method with the given arguments on the ACTUAL result.
-
#to_lookout_expected ⇒ Expected::Lookout::Actual::Method
An expected value wrapper of the receiver.
-
#to_s ⇒ Object
(also: #inspect)
A string of the form “#method(args){ … }”, depending on if any arguments or block has been given.
Instance Method Details
#call(actual) ⇒ Object
Returns The result of invoking the method with the given arguments on the ACTUAL result.
15 |
# File 'lib/lookout-3.0/actual/method.rb', line 15 def call(actual) actual.__send__(method, *args, &block) end |
#to_lookout_expected ⇒ Expected::Lookout::Actual::Method
Returns An expected value wrapper of the receiver.
19 |
# File 'lib/lookout-3.0/actual/method.rb', line 19 def to_lookout_expected; Lookout::Expected::Lookout::Actual::Method.new(self) end |
#to_s ⇒ Object Also known as: inspect
Returns A string of the form “#method(args){ … }”, depending on if any arguments or block has been given.
23 24 25 26 27 28 |
# File 'lib/lookout-3.0/actual/method.rb', line 23 def to_s ['#', method, args.empty? ? '' : '(%s)' % Lookout::Inspect.args(*args), block ? '{ … }' : ''].join('') end |