diff --git a/lib/contracts/call_with.rb b/lib/contracts/call_with.rb index c9a3720..d378c06 100644 --- a/lib/contracts/call_with.rb +++ b/lib/contracts/call_with.rb @@ -81,18 +81,8 @@ def call_with_inner(returns, this, *args, &blk) method.call(*args, &blk) else # original method name reference - target_block = nil - blk_is_contract = false - if blk - if blk.is_a?(Contract) # rubocop:disable Style/IfUnlessModifier - blk_is_contract = true - end - end - if blk_is_contract # rubocop:disable Style/ConditionalAssignment - target_block = lambda { |*params| blk.call(*params) } - else - target_block = blk - end + target_block = blk + target_block = lambda { |*params| blk.call(*params) } if blk_is_contract method.send_to(this, *args, &target_block) end