Class: Lookout::Actual::Method

Inherits:
Object
  • Object
show all
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

Not::Method

Instance Method Summary collapse

Instance Method Details

#call(actual) ⇒ Object

Returns The result of invoking the method with the given arguments on the ACTUAL result.

Parameters:

Returns:

  • (Object)

    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_expectedExpected::Lookout::Actual::Method

Returns An expected value wrapper of the receiver.

Returns:



19
# File 'lib/lookout-3.0/actual/method.rb', line 19

def to_lookout_expected; Lookout::Expected::Lookout::Actual::Method.new(self) end

#to_sObject Also known as: inspect

Returns A string of the form “#method(args){ … }”, depending on if any arguments or block has been given.

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