Sha256: a83c213a20a0f414de3a70beb39a1db27690cb10242786874b479283e5164dc3

Contents?: true

Size: 657 Bytes

Versions: 1

Compression:

Stored size: 657 Bytes

Contents

class Pupil
  # @return [Hash] lists
  def lists(param={})
    if param[:contains]
      response = self.get("lists/memberships.json", param.reject{|p|p==:contains}.update(guess_parameter(param[:contains]) => param[:contains]))
      response = response["lists"]
    else
      response = self.get("lists/all.json", param)
    end
    return [] unless response
    lists = Array.new
    response.each do |list|
      lists << List.new(list, @access_token)
    end
    return lists
  end
  
  def create_list(name, option={})
    response = self.post("lists/create.json", {:name => name}.update(option))
    return List.new(response, @access_token)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pupil-0.7 lib/pupil/lists.rb