Class: LunaApi::Todo

Inherits:
Object
  • Object
show all
Defined in:
lib/luna_api/todo.rb

Class Method Summary collapse

Class Method Details

.complete(id) ⇒ Object



14
15
16
17
# File 'lib/luna_api/todo.rb', line 14

def self.complete(id)
  response = LunaApi::Request.put("http://todo.lunasandals.com/todo/#{id}/complete")
  handle_response(response)
end

.create(attrs) ⇒ Object



9
10
11
12
# File 'lib/luna_api/todo.rb', line 9

def self.create(attrs)
  response = LunaApi::Request.post("http://todo.lunasandals.com/todo", :params => {:todo => attrs})
  handle_response(response)
end

.getObject



4
5
6
7
# File 'lib/luna_api/todo.rb', line 4

def self.get
  response = LunaApi::Request.get("http://todo.lunasandals.com/")
  response.body
end

.tagsObject



24
25
26
27
# File 'lib/luna_api/todo.rb', line 24

def self.tags
  response = LunaApi::Request.get("http://todo.lunasandals.com/tags")
  response.body
end

.update(id, attrs) ⇒ Object



19
20
21
22
# File 'lib/luna_api/todo.rb', line 19

def self.update(id, attrs)
  response = LunaApi::Request.post("http://todo.lunasandals.com/todo/#{id}", :params => {:todo => attrs})
  handle_response(response)
end