Class: PewPew::Resources::Mailboxes

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

Instance Method Summary collapse

Instance Method Details

#allMash

Fetches all defined mailboxes.

Returns:

  • (Mash)

    the response body



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

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

#create(params) ⇒ Mash

Creates a new mailbox.

Parameters:

  • params (Hash)

    a customizable set of options

Options Hash (params):

  • :mailbox (String)

    the name of the mailbox

  • :password (String)

    the mailbox password

Returns:

  • (Mash)

    the response body



19
20
21
# File 'lib/pew_pew/resources/mailboxes.rb', line 19

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

#remove(mailbox) ⇒ Mash

Removes an existing mailbox by mailbox name.

Parameters:

  • mailbox (String)

    the name of the mailbox to be deleted

Returns:

  • (Mash)

    the response body



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

def remove(mailbox)
  delete("#{domain}/mailboxes/#{mailbox}")
end

#update(mailbox, params) ⇒ Mash

Updates an existing mailbox by mailbox name.

Parameters:

  • mailbox (String)

    the name of the mailbox to be updated

  • params (Hash)

    a customizable set of options

Options Hash (params):

  • :password (String)

    the mailbox password

Returns:

  • (Mash)

    the response body



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

def update(mailbox, params)
  put("#{domain}/mailboxes/#{mailbox}", params)
end