Class: WipApi::Todo
- Inherits:
-
Object
- Object
- WipApi::Todo
- Defined in:
- lib/wip_api/todo.rb
Instance Method Summary collapse
- #complete(todo_id) ⇒ Object
- #create(attributes = {}) ⇒ Object
-
#initialize(client = Client.new) ⇒ Todo
constructor
A new instance of Todo.
Constructor Details
Instance Method Details
#complete(todo_id) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/wip_api/todo.rb', line 21 def complete(todo_id) query = %{ mutation completeTodo { completeTodo(id: #{todo_id}) { id body completed_at } } } json = @client.make_request(query) json["data"]["completeTodo"] end |
#create(attributes = {}) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/wip_api/todo.rb', line 7 def create(attributes = {}) query = %{ mutation createTodo { createTodo(input: {#{serialize_attributes(attributes)}}) { id body completed_at } } } json = @client.make_request(query) json["data"]["createTodo"] end |