Module: Vapir::Firefox::ModalDialogContainer

Included in:
Vapir::Firefox, ModalDialogDocument
Defined in:
lib/vapir-firefox/modal_dialog.rb

Overview

this module is for objects that can launch modal dialogs of their own. such things are a Firefox Browser, and a Firefox::ModalDialogDocument.

Instance Method Summary collapse

Instance Method Details

returns a Firefox::ModalDialog.

you may specify an options hash. keys supported are those supported by the second argument to Firefox::ModalDialog#initialize, except that :error is overridden to false (use #modal_dialog!) if you want an exception to raise)



90
91
92
93
# File 'lib/vapir-firefox/modal_dialog.rb', line 90

def modal_dialog(options={})
  modal=Firefox::ModalDialog.new(self, options.merge(:error => false))
  modal.exists? ? modal : nil
end

returns #modal_dialog if it exists; otherwise, errors. use this with the expectation that the dialog does exist. use #modal_dialog when you will check if it exists.



97
98
99
# File 'lib/vapir-firefox/modal_dialog.rb', line 97

def modal_dialog!(options={})
  Firefox::ModalDialog.new(self, options.merge(:error => true))
end