Class: Glib::JsonCrawler::WindowsOpen
- Inherits:
-
ActionCrawler
- Object
- ActionCrawler
- Glib::JsonCrawler::WindowsOpen
- Defined in:
- lib/glib/json_crawler/action_crawlers/windows_open.rb
Instance Method Summary collapse
-
#initialize(http, args, action) ⇒ WindowsOpen
constructor
A new instance of WindowsOpen.
Methods inherited from ActionCrawler
Constructor Details
#initialize(http, args, action) ⇒ WindowsOpen
Returns a new instance of WindowsOpen.
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/glib/json_crawler/action_crawlers/windows_open.rb', line 4 def initialize(http, args, action) @http = http if (url = args['url']) json = @http.get(url, action, args.except('url')) unless json.nil? @http.router.begin_page(json, url) crawl json['header']&.[]('childViews') crawl json['body']&.[]('childViews') crawl json['footer']&.[]('childViews') json['rightButtons']&.each do || if ['buttons'].present? ['buttons'].each do || click end else click end end if (on_load = args.fetch('onLoad', nil)) perform(on_load) end @http.router.end_page(json) end end end |