Class: Exa::Services::Websets::Monitors::Get

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

Instance Method Summary collapse

Constructor Details

#initialize(connection, id:, **params) ⇒ Get

Returns a new instance of Get.



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

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

Instance Method Details

#callObject



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/exa/services/websets/monitors/get.rb', line 14

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

  Resources::Monitor.new(
    id: body["id"],
    object: body["object"],
    status: body["status"],
    webset_id: body["websetId"],
    cadence: body["cadence"],
    behavior: body["behavior"],
    created_at: body["createdAt"],
    updated_at: body["updatedAt"]
  )
end