Class: Osaka::TypicalSaveDialog
- Inherits:
-
Object
- Object
- Osaka::TypicalSaveDialog
- Defined in:
- lib/osaka/typicalapplication.rb
Instance Attribute Summary collapse
-
#wrapper ⇒ Object
Returns the value of attribute wrapper.
Instance Method Summary collapse
- #click_save ⇒ Object
-
#initialize(location, wrapper) ⇒ TypicalSaveDialog
constructor
A new instance of TypicalSaveDialog.
- #save(filename) ⇒ Object
- #set_filename(filename) ⇒ Object
- #set_folder(pathname) ⇒ Object
Constructor Details
#initialize(location, wrapper) ⇒ TypicalSaveDialog
Returns a new instance of TypicalSaveDialog.
7 8 9 10 |
# File 'lib/osaka/typicalapplication.rb', line 7 def initialize(location, wrapper) @location = location @wrapper = wrapper end |
Instance Attribute Details
#wrapper ⇒ Object
Returns the value of attribute wrapper.
5 6 7 |
# File 'lib/osaka/typicalapplication.rb', line 5 def wrapper @wrapper end |
Instance Method Details
#click_save ⇒ Object
22 23 24 |
# File 'lib/osaka/typicalapplication.rb', line 22 def click_save @wrapper.click_and_wait_until_not_exists("button \"Save\" of #{@location}", "#{@location}") end |
#save(filename) ⇒ Object
26 27 28 29 30 |
# File 'lib/osaka/typicalapplication.rb', line 26 def save(filename) set_filename(File.basename(filename)) set_folder(File.dirname(filename)) unless File.dirname(filename) == "." click_save end |
#set_filename(filename) ⇒ Object
12 13 14 |
# File 'lib/osaka/typicalapplication.rb', line 12 def set_filename(filename) @wrapper.set("value of text field 1 of #{@location}", filename) end |
#set_folder(pathname) ⇒ Object
16 17 18 19 20 |
# File 'lib/osaka/typicalapplication.rb', line 16 def set_folder(pathname) @wrapper.keystroke_and_wait_until_exists("g", [ :command, :shift ], "sheet 1 of #{@location}") @wrapper.set("value of text field 1 of sheet 1 of #{@location}", pathname) @wrapper.click_and_wait_until_not_exists("button \"Go\" of sheet 1 of #{@location}", "sheet 1 of #{@location}") end |