Sha256: df6049d02b763e89d776396c63705a052fd1b4e383c0d7f97ecc2da742cfc62a
Contents?: true
Size: 689 Bytes
Versions: 23
Compression:
Stored size: 689 Bytes
Contents
module StringMasterProxy # This should be used on a String to get access to # StringMaster's methods. Two notations are available: # - Block notation: # String#prep { |s| s.cut(...); s.break_long_words } # - Chained methods notation # String#prep.cut(...).break_long_words(...) # # Beware that in (1) a String object is returned, while in (2) a StringMaster object is returned # (although StringMaster has a #to_s method). def prep if block_given? @string_master ||= StringMaster.new(self) self.replace yield(@string_master).to_s self else StringMaster.new(self) end end end class String include StringMasterProxy end
Version data entries
23 entries across 23 versions & 1 rubygems