Class: Providence::Eye
- Inherits:
-
Object
- Object
- Providence::Eye
- Defined in:
- lib/providence/eye.rb
Instance Attribute Summary collapse
-
#ec ⇒ Object
Returns the value of attribute ec.
-
#watchrs ⇒ Object
Returns the value of attribute watchrs.
Class Method Summary collapse
- .get_image(image_name) ⇒ Object
- .growl(message, image = info_image, title = 'Providence') ⇒ Object
- .method_missing(sym, *arguments, &block) ⇒ Object
Instance Method Summary collapse
-
#initialize(eval_context, *args) ⇒ Eye
constructor
A new instance of Eye.
- #run_suite ⇒ Object
- #watch ⇒ Object
Constructor Details
#initialize(eval_context, *args) ⇒ Eye
Returns a new instance of Eye.
23 24 25 26 |
# File 'lib/providence/eye.rb', line 23 def initialize eval_context, *args @ec = eval_context @watchrs = args || [] end |
Instance Attribute Details
#ec ⇒ Object
Returns the value of attribute ec.
3 4 5 |
# File 'lib/providence/eye.rb', line 3 def ec @ec end |
#watchrs ⇒ Object
Returns the value of attribute watchrs.
3 4 5 |
# File 'lib/providence/eye.rb', line 3 def watchrs @watchrs end |
Class Method Details
.get_image(image_name) ⇒ Object
6 7 8 |
# File 'lib/providence/eye.rb', line 6 def get_image(image_name) File.join(File.(File.dirname(__FILE__)), '..', '..', 'images', 'glass', "#{image_name}.png") end |
.growl(message, image = info_image, title = 'Providence') ⇒ Object
18 19 20 |
# File 'lib/providence/eye.rb', line 18 def growl(, image=info_image, title='Providence') Growl.notify , :title => title, :icon => image end |
.method_missing(sym, *arguments, &block) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/providence/eye.rb', line 10 def method_missing(sym, *arguments, &block) if sym.to_s =~ /^(.*)_image$/ get_image($1) else super end end |
Instance Method Details
#run_suite ⇒ Object
28 29 30 |
# File 'lib/providence/eye.rb', line 28 def run_suite watchrs.each {|w| w.class.run_all } end |
#watch ⇒ Object
32 33 34 |
# File 'lib/providence/eye.rb', line 32 def watch watchrs.each {|w| w.watch(ec) } end |