Class: Pwl::Dialog::CocoaDialog
- Inherits:
-
SystemDialog
- Object
- Base
- SystemDialog
- Pwl::Dialog::CocoaDialog
- Defined in:
- lib/pwl/dialog/cocoa.rb
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#get_input ⇒ Object
CocoaDialog returns two lines.
Methods inherited from Base
Constructor Details
This class inherits a constructor from Pwl::Dialog::Base
Instance Method Details
#get_input ⇒ Object
CocoaDialog returns two lines. The first line contains the number of the button, and the second line contains the actual user input. This method amends the base method with handling the two lines.
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/pwl/dialog/cocoa.rb', line 8 def get_input result = super.lines.to_a result = [] if result.blank? case result.size when 1 then return_or_cancel(result[0], '') when 2 then return_or_cancel(result[0], result[1].chomp) else raise "Unknown response from running '#{command}'" end end |