Class: Exa::Services::Websets::Monitors::List

Inherits:
Object
  • Object
show all
Defined in:
lib/exa/services/websets/monitors/list.rb

Instance Method Summary collapse

Constructor Details

#initialize(connection, **params) ⇒ List

Returns a new instance of List.



8
9
10
11
# File 'lib/exa/services/websets/monitors/list.rb', line 8

def initialize(connection, **params)
  @connection = connection
  @params = params
end

Instance Method Details

#callObject



13
14
15
16
17
18
19
20
21
22
# File 'lib/exa/services/websets/monitors/list.rb', line 13

def call
  response = @connection.get("/websets/v0/monitors", @params)
  body = response.body

  Resources::MonitorCollection.new(
    data: body["data"],
    has_more: body["hasMore"],
    next_cursor: body["nextCursor"]
  )
end