Class: Glib::JsonCrawler::WindowsOpen

Inherits:
ActionCrawler show all
Defined in:
lib/glib/json_crawler/action_crawlers/windows_open.rb

Instance Method Summary collapse

Methods inherited from ActionCrawler

#click, #crawl

Constructor Details

#initialize(http, args, controller) ⇒ WindowsOpen

Returns a new instance of WindowsOpen.



4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/glib/json_crawler/action_crawlers/windows_open.rb', line 4

def initialize http, args, controller
  @http = http
  json = @http.get args['url'], controller

  unless json.nil?
    crawl json['header']&.[]('childViews')
    crawl json['body']&.[]('childViews')
    crawl json['footer']&.[]('childViews')

    json['rightNavButtons']&.each do |button|
      click button
    end
  end
end