Class: ChuckTesta::GnomeNotify
- Inherits:
-
Object
- Object
- ChuckTesta::GnomeNotify
- Defined in:
- lib/chuck_testar.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
-
#icon ⇒ Object
Returns the value of attribute icon.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
- #build_params ⇒ Object
-
#initialize(params = {}) ⇒ GnomeNotify
constructor
A new instance of GnomeNotify.
- #installed? ⇒ Boolean
- #notify! ⇒ Object
Constructor Details
#initialize(params = {}) ⇒ GnomeNotify
Returns a new instance of GnomeNotify.
8 9 10 |
# File 'lib/chuck_testar.rb', line 8 def initialize params={} params.each { |k,v| send("#{k}=", v) } end |
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
6 7 8 |
# File 'lib/chuck_testar.rb', line 6 def description @description end |
#icon ⇒ Object
Returns the value of attribute icon.
6 7 8 |
# File 'lib/chuck_testar.rb', line 6 def icon @icon end |
#title ⇒ Object
Returns the value of attribute title.
6 7 8 |
# File 'lib/chuck_testar.rb', line 6 def title @title end |
Instance Method Details
#build_params ⇒ Object
12 13 14 |
# File 'lib/chuck_testar.rb', line 12 def build_params "-i #{icon} \"#{title}\" \"#{description}\"" end |
#installed? ⇒ Boolean
20 21 22 |
# File 'lib/chuck_testar.rb', line 20 def installed? `which notify-send`.empty? ? false : true end |
#notify! ⇒ Object
16 17 18 |
# File 'lib/chuck_testar.rb', line 16 def notify! installed? ? `notify-send #{build_params}` : print_hint end |