Method: Typekit::Library.find

Defined in:
lib/typekit/library.rb

.find(id, params = {}) ⇒ Array

Gets a paginated list of families available in the specified library

Parameters:

  • params (Hash) (defaults to: {})

    a customizable set of options

Options Hash (params):

  • :page (Fixnum) — default: 1

    Page number to retrieve

  • :per_page (Fixnum) — default: 20

    Number of results to fetch per page

Returns:

  • (Array)

    Array of Typekit::Family objects available in the specified library



20
21
22
23
24
25
26
# File 'lib/typekit/library.rb', line 20

def find(id, params = {})
  { :page => 1, :per_page => 20 }.merge!(params)
  library = Client.get("/libraries/#{id}", :query => params)
  library['families'].inject([]) do |families, attributes|
    families << Family.new(attributes)
  end
end