Class: Exa::Services::Websets::Monitors::Update
- Inherits:
-
Object
- Object
- Exa::Services::Websets::Monitors::Update
- Defined in:
- lib/exa/services/websets/monitors/update.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(connection, id:, **params) ⇒ Update
constructor
A new instance of Update.
Constructor Details
#initialize(connection, id:, **params) ⇒ Update
Returns a new instance of Update.
8 9 10 11 12 |
# File 'lib/exa/services/websets/monitors/update.rb', line 8 def initialize(connection, id:, **params) @connection = connection @id = id @params = params end |
Instance Method Details
#call ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/exa/services/websets/monitors/update.rb', line 14 def call response = @connection.patch("/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 |