Module: Deco

Included in:
Rprompt::PromptItem
Defined in:
lib/rprompt/deco.rb

Instance Method Summary collapse

Instance Method Details

#termShow(args) ⇒ String

Returns colorized content string and symbol according to configuration.

Parameters:

  • args (Hash)
    • :color: color [String]

    • :symbol: character [String]

    • :content: content [String]

Returns:

  • (String)

    colorized content string and symbol according to configuration



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/rprompt/deco.rb', line 7

def termShow(args)
  color = args[:color]
  symbol = args[:symbol]
  content = args[:content]

  if color
      if symbol
        "#{symbol}#{content}".send(color)
      else
        "#{content}".send(color)
      end
    else
      if symbol
        "#{symbol}#{content}"
      else
        "#{content}"
      end
    end
end