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.



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

def color
  @color
end

#styleObject

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