class String

Public Instance Methods

format_all() click to toggle source
# File lib/everyday-cli-utils/format.rb, line 23
def format_all
  EverydayCliUtils::Format::format_all(self)
end
method_missing(method, *args) click to toggle source
# File lib/everyday-cli-utils/format.rb, line 7
def method_missing(method, *args)
  name   = method.to_s
  colors = 'black|red|green|yellow|blue|purple|cyan|white|none'
  if (name =~ /format(_bold)?(_underline)?(?:_fg_(#{colors}))?(?:_bg_(#{colors}))?/).nil?
    old_method_missing(method, *args)
  else
    EverydayCliUtils::Format::format(self, EverydayCliUtils::Format::build_string(!$1.nil?, !$2.nil?, $3.nil? ? nil : $3.to_sym, $4.nil? ? nil : $4.to_sym))
  end
end
Also aliased as: old_method_missing
mycenter(len, char = ' ') click to toggle source
# File lib/everyday-cli-utils/format.rb, line 31
def mycenter(len, char = ' ')
  EverydayCliUtils::Format::mycenter(self, len, char)
end
old_method_missing(method, *args)
Alias for: method_missing
old_respond_to?(method, include_all = false)
Alias for: respond_to?
remove_format() click to toggle source
# File lib/everyday-cli-utils/format.rb, line 27
def remove_format
  EverydayCliUtils::Format::remove_format(self)
end
respond_to?(method, include_all = false) click to toggle source
# File lib/everyday-cli-utils/format.rb, line 17
def respond_to?(method, include_all = false)
  name   = method.to_s
  colors = 'black|red|green|yellow|blue|purple|cyan|white|none'
  (!(name =~ /format(_bold)?(_underline)?(?:_fg_(#{colors}))?(?:_bg_(#{colors}))?/).nil?) || old_respond_to?(method, include_all)
end
Also aliased as: old_respond_to?