Class: Ccp::Receivers::Commentable::Comment

Inherits:
Struct
  • Object
show all
Includes:
Utils::Colorize
Defined in:
lib/ccp/receivers/commentable.rb,
lib/ccp/receivers/commentable.rb

Constant Summary

Constants included from Utils::Colorize::Fore

Utils::Colorize::Fore::BLACK, Utils::Colorize::Fore::BLUE, Utils::Colorize::Fore::CLEAR, Utils::Colorize::Fore::CYAN, Utils::Colorize::Fore::GREEN, Utils::Colorize::Fore::MAGENTA, Utils::Colorize::Fore::RED, Utils::Colorize::Fore::WHITE, Utils::Colorize::Fore::YELLOW

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Utils::Colorize

strip

Methods included from Utils::Colorize::Fore

#aqua, #black, #blue, #colorize, #cyan, #green, #magenta, #pink, #purple, #red, #white, #yellow

Instance Attribute Details

#levelObject

Returns the value of attribute level

Returns:

  • (Object)

    the current value of level



5
6
7
# File 'lib/ccp/receivers/commentable.rb', line 5

def level
  @level
end

#textObject

Returns the value of attribute text

Returns:

  • (Object)

    the current value of text



5
6
7
# File 'lib/ccp/receivers/commentable.rb', line 5

def text
  @text
end

Instance Method Details

#colorizedObject



8
9
10
11
12
13
14
15
# File 'lib/ccp/receivers/commentable.rb', line 8

def colorized
  case level
  when :warn          ; yellow(text)
  when :error, :fatal ; red(text)
  when :info          ; green(text)
  else                ; text
  end
end