public Method

GeneratorMethods.delay(seconds = 1) { || ... }

Executes the content of the block after a delay of seconds. Example:

# Generates:
#     setTimeout(function() {
#     ;
#     new Effect.Fade("notice",{});
#     }, 20000);
page.delay(20) do
  page.visual_effect :fade, 'notice'
end

Source Code

# File action_view/helpers/prototype_helper.rb, line 903
def delay(seconds = 1)
  record "setTimeout(function() {\n\n"
  yield
  record "}, #{(seconds * 1000).to_i})"
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.