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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Utils::Colorize

#aqua, #blue, #colorize, #green, #pink, #red, #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