Class: String

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

Instance Method Summary collapse

Instance Method Details

#boldObject

Returns a copy of this string with terminal escapes to bold it



4
5
6
# File 'lib/buckler/strings.rb', line 4

def bold
  "\033[1m#{self}\e[0m"
end

#bucketize(color = :orange) ⇒ Object

Returns a copy of this string with terminal escapes to make it a color Options: :orange or :pink



15
16
17
18
19
20
21
22
# File 'lib/buckler/strings.rb', line 15

def bucketize(color = :orange)
  case color
  when :pink
    "\e[38;5;206m#{self}\e[0m"
  else
    "\e[38;5;208m#{self}\e[0m"
  end
end

#dangerizeObject

Returns a copy of this string with terminal escapes to make it red



9
10
11
# File 'lib/buckler/strings.rb', line 9

def dangerize
  "\e[38;5;196m#{self}\e[0m"
end