Class: Proc
- Defined in:
- opal/browser/delay.rb,
opal/browser/interval.rb,
opal/browser/immediate.rb,
opal/browser/animation_frame.rb
Instance Method Summary collapse
-
#after(time) ⇒ Delay
Execute a block after the given seconds.
-
#after!(time) ⇒ Delay
Execute a block after the given seconds, you have to call [#start] on it yourself.
- #animation_frame ⇒ Object
- #defer(*args, &block) ⇒ Object
-
#every(time) ⇒ Interval
Execute the block every given seconds.
-
#every!(time) ⇒ Interval
Execute the block every given seconds, you have to call [#start] on it yourself.
Instance Method Details
#after(time) ⇒ Delay
Execute a block after the given seconds.
70 71 72 |
# File 'opal/browser/delay.rb', line 70 def after(time) $window.after(time, &self) end |
#after!(time) ⇒ Delay
Execute a block after the given seconds, you have to call [#start] on it yourself.
75 76 77 |
# File 'opal/browser/delay.rb', line 75 def after!(time) $window.after!(time, &self) end |
#animation_frame ⇒ Object
108 109 110 |
# File 'opal/browser/animation_frame.rb', line 108 def animation_frame Browser::AnimationFrame.new($window, &self) end |
#defer(*args, &block) ⇒ Object
143 144 145 |
# File 'opal/browser/immediate.rb', line 143 def defer(*args, &block) Browser::Immediate.new(self, args, &block).tap(&:dispatch) end |
#every(time) ⇒ Interval
Execute the block every given seconds.
103 104 105 |
# File 'opal/browser/interval.rb', line 103 def every(time) $window.every(time, &self) end |
#every!(time) ⇒ Interval
Execute the block every given seconds, you have to call [#start] on it yourself.
108 109 110 |
# File 'opal/browser/interval.rb', line 108 def every!(time) $window.every!(time, &self) end |