Class: Mandrill::Urls

Inherits:
Object
  • Object
show all
Defined in:
lib/mandrill/api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(master) ⇒ Urls

Returns a new instance of Urls.



611
612
613
# File 'lib/mandrill/api.rb', line 611

def initialize(master)
    @master = master
end

Instance Attribute Details

#masterObject

Returns the value of attribute master.



609
610
611
# File 'lib/mandrill/api.rb', line 609

def master
  @master
end

Instance Method Details

#listArray

Get the 100 most clicked URLs

Returns:

  • (Array)

    the 100 most clicked URLs and their stats

    • Hash

      return[] the individual URL stats

      - [String] url the URL to be tracked
      - [Integer] sent the number of emails that contained the URL
      - [Integer] clicks the number of times the URL has been clicked from a tracked email
      - [Integer] unique_clicks the number of unique emails that have benerated clicks for this URL
      


622
623
624
625
# File 'lib/mandrill/api.rb', line 622

def list()
    _params = {}
    return @master.call 'urls/list', _params
end

#search(q) ⇒ Array

Return the 100 most clicked URLs that match the search query given

Parameters:

  • q (String)

    a search query

Returns:

  • (Array)

    the 100 most clicked URLs matching the search query

    • Hash

      return[] the URL matching the query

      - [String] url the URL to be tracked
      - [Integer] sent the number of emails that contained the URL
      - [Integer] clicks the number of times the URL has been clicked from a tracked email
      - [Integer] unique_clicks the number of unique emails that have benerated clicks for this URL
      


635
636
637
638
# File 'lib/mandrill/api.rb', line 635

def search(q)
    _params = {:q => q}
    return @master.call 'urls/search', _params
end

#time_series(url) ⇒ Array

Return the recent history (hourly stats for the last 30 days) for a url

Parameters:

  • url (String)

    an existing URL

Returns:

  • (Array)

    the array of history information

    • Hash

      return[] the information for a single hour

      - [String] time the hour as a UTC date string in YYYY-MM-DD HH:MM:SS format
      - [Integer] sent the number of emails that were sent with the URL during the hour
      - [Integer] clicks the number of times the URL was clicked during the hour
      - [Integer] unique_clicks the number of unique clicks generated for emails sent with this URL during the hour
      


648
649
650
651
# File 'lib/mandrill/api.rb', line 648

def time_series(url)
    _params = {:url => url}
    return @master.call 'urls/time-series', _params
end