Class: Rprompt::PromptItem
Instance Attribute Summary collapse
-
#color ⇒ Object
readonly
Returns the value of attribute color.
-
#symbol ⇒ Object
readonly
Returns the value of attribute symbol.
Instance Method Summary collapse
-
#commandResult ⇒ String
executes prompt item command.
-
#initialize(config) ⇒ PromptItem
constructor
A new instance of PromptItem.
Methods included from Deco
Constructor Details
#initialize(config) ⇒ PromptItem
Returns a new instance of PromptItem.
15 16 17 18 19 |
# File 'lib/rprompt.rb', line 15 def initialize(config) @cmd = config[:cmd] @symbol = config[:symbol] @color = config[:color] end |
Instance Attribute Details
#color ⇒ Object (readonly)
Returns the value of attribute color.
9 10 11 |
# File 'lib/rprompt.rb', line 9 def color @color end |
#symbol ⇒ Object (readonly)
Returns the value of attribute symbol.
9 10 11 |
# File 'lib/rprompt.rb', line 9 def symbol @symbol end |
Instance Method Details
#commandResult ⇒ String
executes prompt item command
23 24 25 |
# File 'lib/rprompt.rb', line 23 def commandResult %x(#{@cmd} 2> /dev/null) end |