rectify icon indicating copy to clipboard operation
rectify copied to clipboard

Document Command::call method fallback behavior when block is given

Open szpasztor opened this issue 6 years ago • 1 comments

When supplying a block to Rectify::Command::call, the calling object instance is saved and its methods become available on the command object as well.

  • This should be documented in the readme, as it introduces the possibility of subtle bugs. Eg. if used with rails, accidentally typing params vs @params in the command object won't cause any errors because params is defined on ActionController, but results in unexpected behavior which is also hard to trace.
  • When the block is omitted, the caller object doesn't get registered and thus its methods don't become available to the command. It might be helpful to document/warn against this as well.

szpasztor avatar May 08 '19 21:05 szpasztor

@andypike I can do a PR with added docs if you think this could be useful.

szpasztor avatar May 05 '20 10:05 szpasztor