Class: Mailchimp::Gallery

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(master) ⇒ Gallery

Returns a new instance of Gallery.



2198
2199
2200
# File 'lib/mailchimp/api.rb', line 2198

def initialize(master)
    @master = master
end

Instance Attribute Details

#masterObject

Returns the value of attribute master.



2196
2197
2198
# File 'lib/mailchimp/api.rb', line 2196

def master
  @master
end

Instance Method Details

#list(opts = []) ⇒ Hash

Return a section of the image gallery

Parameters:

  • opts (Hash) (defaults to: [])

    various options for controlling returned data

    • String

      type optional the gallery type to return - images or files - default to images

    • Int

      start optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)

    • Int

      limit optional for large data sets, the number of results to return - defaults to 25, upper limit set at 100

    • String

      sort_by optional field to sort by - one of size, time, name - defaults to time

    • String

      sort_dir optional field to sort by - one of asc, desc - defaults to desc

    • String

      search_term optional a term to search for in names

Returns:

  • (Hash)

    the matching gallery items

    • Int

      total the total matching items

    • Array

      data structs for each item included in the set, including:

      - [String] name the file name
      - [String] time the creation date for the item
      - [Int] size the file size in bytes
      - [String] full the url to the actual item in the gallery
      - [String] thumb a url for a thumbnail that can be used to represent the item, generally an image thumbnail or an icon for a file type
      


2218
2219
2220
2221
# File 'lib/mailchimp/api.rb', line 2218

def list(opts=[])
    _params = {:opts => opts}
    return @master.call 'gallery/list', _params
end