module Acme::Bleach

Constants

VERSION
WhiteChars

Public Class Methods

bleached?(c) click to toggle source
# File lib/acme/bleach.rb, line 9
def bleached? c
  !! c.match(/\A#{Header}/)
end
brighten(c) click to toggle source
# File lib/acme/bleach.rb, line 17
def brighten c
  c.sub!(/\A#{Header}/, '') ? [ c.tr(WhiteChars, "01") ].pack('b*') : c
end
whiten(c) click to toggle source
# File lib/acme/bleach.rb, line 13
def whiten c
  Header + c.unpack( 'b*').join('').tr("01", WhiteChars)
end