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
-
#modal_dialog(options = {}) ⇒ Object
returns a Firefox::ModalDialog.
-
#modal_dialog!(options = {}) ⇒ Object
returns #modal_dialog if it exists; otherwise, errors.
Instance Method Details
#modal_dialog(options = {}) ⇒ Object
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(={}) modal=Firefox::ModalDialog.new(self, .merge(:error => false)) modal.exists? ? modal : nil end |
#modal_dialog!(options = {}) ⇒ Object
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!(={}) Firefox::ModalDialog.new(self, .merge(:error => true)) end |