Method: Contract#maybe_append_block!

Defined in:
lib/contracts.rb

#maybe_append_block!(args, blk) ⇒ Object

a better way to handle this might be to take this into account before throwing a “mismatched # of args” error. returns true if it appended nil



246
247
248
249
250
251
252
# File 'lib/contracts.rb', line 246

def maybe_append_block! args, blk
  return false unless @has_proc_contract && !blk &&
    (@args_contract_index || args.size < args_contracts.size)

  args << nil
  true
end