Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/amun/helpers/colors.rb
Overview
for easier printing of colored string on the screen we can add color property to any string and then use it to print the string on the screen
Instance Attribute Summary collapse
-
#color ⇒ Object
Returns the value of attribute color.
-
#style ⇒ Object
Returns the value of attribute style.
Instance Method Summary collapse
Instance Attribute Details
#color ⇒ Object
Returns the value of attribute color.
103 104 105 |
# File 'lib/amun/helpers/colors.rb', line 103 def color @color end |
#style ⇒ Object
Returns the value of attribute style.
103 104 105 |
# File 'lib/amun/helpers/colors.rb', line 103 def style @style end |
Instance Method Details
#colorize(color, style = Amun::Helpers::Colors::NORMAL) ⇒ Object
105 106 107 108 109 |
# File 'lib/amun/helpers/colors.rb', line 105 def colorize(color, style = Amun::Helpers::Colors::NORMAL) self.color = color self.style = style self end |