Module: Bowline::Desktop::JS
- Defined in:
- lib/bowline/desktop/js.rb
Overview
:nodoc:
Defined Under Namespace
Classes: Script
Class Method Summary collapse
- .eval(window, string, method = nil, &block) ⇒ Object
- .poll ⇒ Object
- .scripts ⇒ Object
-
.setup! ⇒ Object
:nodoc:.
Class Method Details
.eval(window, string, method = nil, &block) ⇒ Object
64 65 66 67 68 69 70 71 |
# File 'lib/bowline/desktop/js.rb', line 64 def eval(window, string, method = nil, &block) script = Script.new(window, string, method||block) if Runtime.main_thread? && script.ready? script.call else scripts << script end end |
.poll ⇒ Object
75 76 77 78 79 80 81 |
# File 'lib/bowline/desktop/js.rb', line 75 def poll ready_scripts = scripts.select(&:ready?) ready_scripts.each do |script| script.call scripts.delete(script) end end |
.scripts ⇒ Object
84 85 86 |
# File 'lib/bowline/desktop/js.rb', line 84 def scripts @scripts ||= [] end |