Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/freshen/helpers/string.rb
Class Method Summary collapse
-
.ballot ⇒ Object
A UTF-8 ballot.
-
.checkmark ⇒ Object
A UTF-8 checkmark.
-
.prefix ⇒ Object
A simple string prefix.
Instance Method Summary collapse
-
#blue ⇒ Object
Make a string blue.
-
#bold ⇒ Object
Make a string bold.
-
#gray ⇒ Object
Make a string gray.
-
#green ⇒ Object
Make a string green.
-
#red ⇒ Object
Make a string red.
-
#yellow ⇒ Object
Make a string yellow.
Class Method Details
.ballot ⇒ Object
A UTF-8 ballot.
Example:
>> String.ballot
=> "✘"
28 29 30 |
# File 'lib/freshen/helpers/string.rb', line 28 def self.ballot "\u2718" end |
.checkmark ⇒ Object
A UTF-8 checkmark.
Example:
>> String.checkmark
=> "✔"
18 19 20 |
# File 'lib/freshen/helpers/string.rb', line 18 def self.checkmark "\u2714" end |
.prefix ⇒ Object
A simple string prefix.
Example:
>> String.prefix
=> "==>"
8 9 10 |
# File 'lib/freshen/helpers/string.rb', line 8 def self.prefix "==>" end |
Instance Method Details
#blue ⇒ Object
Make a string blue.
Example:
>> puts "freshen".blue
=> "\e[34mfreshen\e[0m"
78 79 80 |
# File 'lib/freshen/helpers/string.rb', line 78 def blue modify(34) end |
#bold ⇒ Object
Make a string bold.
Example:
>> puts "freshen".bold
=> "\e[1mfreshen\e[0m"
38 39 40 |
# File 'lib/freshen/helpers/string.rb', line 38 def bold modify(1) end |
#gray ⇒ Object
Make a string gray.
Example:
>> puts "freshen".gray
=> "\e[37mfreshen\e[0m"
88 89 90 |
# File 'lib/freshen/helpers/string.rb', line 88 def gray modify(37) end |
#green ⇒ Object
Make a string green.
Example:
>> puts "freshen".green
=> "\e[32mfreshen\e[0m"
58 59 60 |
# File 'lib/freshen/helpers/string.rb', line 58 def green modify(32) end |
#red ⇒ Object
Make a string red.
Example:
>> puts "freshen".red
=> "\e[31mfreshen\e[0m"
48 49 50 |
# File 'lib/freshen/helpers/string.rb', line 48 def red modify(31) end |
#yellow ⇒ Object
Make a string yellow.
Example:
>> puts "freshen".yellow
=> "\e[33mfreshen\e[0m"
68 69 70 |
# File 'lib/freshen/helpers/string.rb', line 68 def yellow modify(33) end |