Skip to content

Latest commit

 

History

History
18 lines (15 loc) · 265 Bytes

README.rdoc

File metadata and controls

18 lines (15 loc) · 265 Bytes

respond_to

Easy way to make respond_to? matchers for case statements.

Usage

require 'respond_to'
str = 'my string'
case str
when ~:<<
  str << 'new data'
when ~:push
  str.push 'new data'
when ~:+
  str += 'new data'
else
  raise
end