Class: Glib::JsonCrawler::NavInitiate

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

Instance Method Summary collapse

Methods inherited from ActionCrawler

#click, #crawl, #perform

Constructor Details

#initialize(http, args, action) ⇒ NavInitiate

Returns a new instance of NavInitiate.



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

def initialize(http, args, action)
  super(http)

  @http = http
  if (json = (@http.get args['url'], action, args.except('url'))) && (left_drawer = json['leftDrawer'])
    crawl left_drawer['header']&.[]('childViews')
    crawl left_drawer['rows']
    crawl left_drawer['body']&.[]('childViews')
  end

  # if (on_load = (args.fetch('onLoad', nil)))
  #   perform(on_load)
  # end
end