Class: Hookdeck::Resources::Attempt

Inherits:
Base
  • Object
show all
Defined in:
lib/hookdeck/resources/attempt.rb

Overview

Examples:

List recent attempts

client.attempts.list(limit: 10)

Retrieve specific attempt

attempt = client.attempts.retrieve('atm_123')

Instance Attribute Summary

Attributes inherited from Base

#client

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Hookdeck::Resources::Base

Instance Method Details

#list(params = {}) ⇒ Object



10
11
12
# File 'lib/hookdeck/resources/attempt.rb', line 10

def list(params = {})
  get('attempts', params)
end

#retrieve(id) ⇒ Hash

Retrieves an attempt by ID.

Parameters:

  • id (String)

    The ID of the attempt.

Returns:

  • (Hash)

    The attempt.



18
19
20
21
# File 'lib/hookdeck/resources/attempt.rb', line 18

def retrieve(id)
  validate_id!(id, 'atm_')
  get("attempts/#{id}")
end