Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/bing_dictionary.rb

Constant Summary collapse

COLORS =
%w(black red green yellow blue magenta cyan white)

Instance Method Summary collapse

Instance Method Details

#fixed(width) ⇒ Object



82
83
84
85
# File 'lib/bing_dictionary.rb', line 82

def fixed(width)
  width = width - self.each_char.count { |c| c =~ /\p{Han}/ }
  width > 0 ? ("%-#{width}s" % self) : self
end