Class: Mocktail::ReconstructsCall

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/mocktail/imitates_type/makes_double/declares_dry_class/reconstructs_call.rb,
lib/mocktail/sorbet/mocktail/imitates_type/makes_double/declares_dry_class/reconstructs_call.rb

Instance Method Summary collapse

Instance Method Details

#reconstruct(double:, call_binding:, default_args:, dry_class:, type:, method:, original_method:, signature:) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/mocktail/imitates_type/makes_double/declares_dry_class/reconstructs_call.rb', line 5

def reconstruct(double:, call_binding:, default_args:, dry_class:, type:, method:, original_method:, signature:)
  Call.new(
    singleton: false,
    double: double,
    original_type: type,
    dry_type: dry_class,
    method: method,
    original_method: original_method,
    args: args_for(signature, call_binding, default_args),
    kwargs: kwargs_for(signature, call_binding, default_args),
    block: call_binding.local_variable_get(signature.block_param || ::Mocktail::Signature::DEFAULT_BLOCK_PARAM)
  )
end