Class: Glib::JsonCrawler::ActionCrawler

Inherits:
Object
  • Object
show all
Defined in:
lib/glib/json_crawler/action_crawler.rb

Instance Method Summary collapse

Constructor Details

#initialize(http) ⇒ ActionCrawler

Returns a new instance of ActionCrawler.



4
5
6
# File 'lib/glib/json_crawler/action_crawler.rb', line 4

def initialize(http)
  @http = http
end

Instance Method Details

#click(object) ⇒ Object



8
9
10
# File 'lib/glib/json_crawler/action_crawler.rb', line 8

def click(object)
  @http.router.step(@http, object)
end

#crawl(views) ⇒ Object



12
13
14
15
16
# File 'lib/glib/json_crawler/action_crawler.rb', line 12

def crawl(views)
  @http.router.crawl_multiple views, ->(view) do
    click view
  end
end

#perform(action) ⇒ Object



18
19
20
# File 'lib/glib/json_crawler/action_crawler.rb', line 18

def perform(action)
  @http.router.process_action(@http, action)
end