Class: String

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Instance Attribute Details

#colorObject

Returns the value of attribute color.



102
103
104
# File 'lib/amun/helpers/colors.rb', line 102

def color
  @color
end

#styleObject

Returns the value of attribute style.



102
103
104
# File 'lib/amun/helpers/colors.rb', line 102

def style
  @style
end

Instance Method Details

#colorize(color, style = Amun::Helpers::Colors::NORMAL) ⇒ Object



104
105
106
107
108
# File 'lib/amun/helpers/colors.rb', line 104

def colorize(color, style = Amun::Helpers::Colors::NORMAL)
  self.color = color
  self.style = style
  self
end