class Rprompt::PromptItem
Attributes
color[R]
symbol[R]
Public Class Methods
new(config)
click to toggle source
@param config [Hash] Prompt item configuration:
- :cmd => shell command - :symbol => character - :color => color name
# File lib/rprompt.rb, line 15 def initialize(config) @cmd = config[:cmd] @symbol = config[:symbol] @color = config[:color] end
Public Instance Methods
commandResult()
click to toggle source
executes prompt item command @return [String] command result
# File lib/rprompt.rb, line 23 def commandResult %x(#{@cmd} 2> /dev/null) end