Class: Nemo::Components::ConfirmDialog
- Inherits:
-
Wee::Component
- Object
- Wee::Component
- Nemo::Components::ConfirmDialog
- Defined in:
- lib/nemo/components/confirm.rb
Overview
Confirmation dialog box
Displays a message with OK(true) and Cancel(false) buttons.
Instance Attribute Summary collapse
-
#text ⇒ Object
Returns the value of attribute text.
Instance Method Summary collapse
-
#initialize(text) ⇒ ConfirmDialog
constructor
A new instance of ConfirmDialog.
- #render ⇒ Object
Constructor Details
#initialize(text) ⇒ ConfirmDialog
Returns a new instance of ConfirmDialog.
9 10 11 12 |
# File 'lib/nemo/components/confirm.rb', line 9 def initialize(text) super() @text = text end |
Instance Attribute Details
#text ⇒ Object
Returns the value of attribute text.
7 8 9 |
# File 'lib/nemo/components/confirm.rb', line 7 def text @text end |
Instance Method Details
#render ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/nemo/components/confirm.rb', line 14 def render r.html do r.head { r.title('Confirm') } r.body.style('text-align: center').with do r.break r.encode_text(@text) r.form do r..value('OK').callback{ answer true } r.space r..value('Cancel').callback{ answer false } end r.break end end end |