Class: PewPew::Resources::Bounces

Inherits:
Object
  • Object
show all
Includes:
PewPew::Resource
Defined in:
lib/pew_pew/resources/bounces.rb

Instance Method Summary collapse

Instance Method Details

#allMash

Fetches all bounces.

Returns:

  • (Mash)

    the response body



10
11
12
# File 'lib/pew_pew/resources/bounces.rb', line 10

def all
  get("#{domain}/bounces")
end

#create(params) ⇒ Mash

Creates a new bounce.

Parameters:

  • params (Hash)

    a customizable set of options

Options Hash (params):

  • :address (String)

    the email address to add

  • :code (String)

    error code (defaults to 550)

  • :error (String)

    error description (defaults to blank)

Returns:

  • (Mash)

    the response body



28
29
30
# File 'lib/pew_pew/resources/bounces.rb', line 28

def create(params)
  post("#{domain}/bounces", params)
end

#find(address) ⇒ Mash

Fetch all bounces by address.

Parameters:

  • address (String)

    the address to fetch bounces for

Returns:

  • (Mash)

    the response body



18
19
20
# File 'lib/pew_pew/resources/bounces.rb', line 18

def find(address)
  get("#{domain}/bounces/#{address}")
end

#remove(address_or_id) ⇒ Mash

Removes existing bounces.

Parameters:

  • address_or_id (String)

    the address to remove all the bounces for

Returns:

  • (Mash)

    the response body



36
37
38
# File 'lib/pew_pew/resources/bounces.rb', line 36

def remove(address_or_id)
  delete("#{domain}/bounces/#{address_or_id}")
end