class Todoable::List

Attributes

list_id[RW]
name[RW]
user[RW]

Public Class Methods

new(user) click to toggle source
# File lib/todoable/list.rb, line 5
def initialize(user)
    @user = user
end

Public Instance Methods

create(content) click to toggle source
# File lib/todoable/list.rb, line 13
def create(content)
    user.make_request(LISTS_PATH, :post, { list: {name: content} })
end
delete(id) click to toggle source
# File lib/todoable/list.rb, line 25
def delete(id)
    user.make_request(LISTS_PATH+"/#{id}", :delete)
end
index() click to toggle source
# File lib/todoable/list.rb, line 9
def index
    user.make_request(LISTS_PATH, :get)['lists']
end
show(id) click to toggle source
# File lib/todoable/list.rb, line 17
def show(id)
    user.make_request(LISTS_PATH+"/#{id}", :get)
end
update(id, content) click to toggle source
# File lib/todoable/list.rb, line 21
def update(id, content)
    user.make_request(LISTS_PATH+"/#{id}", :patch, {list: {name: content}} )
end