Class: Logan::Todo

Inherits:
Object
  • Object
show all
Includes:
HashConstructed
Defined in:
lib/logan/todo.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from HashConstructed

#initialize

Instance Attribute Details

#assigneeObject

Returns the value of attribute assignee.



11
12
13
# File 'lib/logan/todo.rb', line 11

def assignee
  @assignee
end

#completedObject

Returns the value of attribute completed.



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

def completed
  @completed
end

#contentObject

Returns the value of attribute content.



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

def content
  @content
end

#due_atObject

Returns the value of attribute due_at.



12
13
14
# File 'lib/logan/todo.rb', line 12

def due_at
  @due_at
end

#idObject

Returns the value of attribute id.



8
9
10
# File 'lib/logan/todo.rb', line 8

def id
  @id
end

Instance Method Details

#post_jsonObject



14
15
16
17
18
19
20
# File 'lib/logan/todo.rb', line 14

def post_json
  {
    :content => @content,
    :due_at => @due_at,
    :assignee => @assignee.to_hash
  }.to_json
end

#put_jsonObject



22
23
24
25
26
27
28
29
# File 'lib/logan/todo.rb', line 22

def put_json
  { 
    :content => @content, 
    :due_at => @due_at,
    :assignee => @assignee.to_hash,
    :completed => @completed
  }.to_json
end