Class: Inbox::Thread
- Inherits:
-
RestfulModel
- Object
- RestfulModel
- Inbox::Thread
- Defined in:
- lib/thread.rb
Instance Attribute Summary collapse
-
#draft_ids ⇒ Object
Returns the value of attribute draft_ids.
-
#first_message_timestamp ⇒ Object
Returns the value of attribute first_message_timestamp.
-
#last_message_timestamp ⇒ Object
Returns the value of attribute last_message_timestamp.
-
#message_ids ⇒ Object
Returns the value of attribute message_ids.
-
#participants ⇒ Object
Returns the value of attribute participants.
-
#snippet ⇒ Object
Returns the value of attribute snippet.
-
#subject ⇒ Object
Returns the value of attribute subject.
-
#tags ⇒ Object
Returns the value of attribute tags.
Attributes inherited from RestfulModel
Instance Method Summary collapse
- #archive! ⇒ Object
- #drafts ⇒ Object
- #inflate(json) ⇒ Object
- #mark_as_read! ⇒ Object
- #mark_as_seen! ⇒ Object
- #messages ⇒ Object
- #star! ⇒ Object
- #unarchive! ⇒ Object
- #unstar! ⇒ Object
- #update_tags!(tags_to_add = [], tags_to_remove = []) ⇒ Object
Methods inherited from RestfulModel
#==, #as_json, collection_name, #destroy, #initialize, #save!, #update, #url
Constructor Details
This class inherits a constructor from Inbox::RestfulModel
Instance Attribute Details
#draft_ids ⇒ Object
Returns the value of attribute draft_ids.
13 14 15 |
# File 'lib/thread.rb', line 13 def draft_ids @draft_ids end |
#first_message_timestamp ⇒ Object
Returns the value of attribute first_message_timestamp.
9 10 11 |
# File 'lib/thread.rb', line 9 def end |
#last_message_timestamp ⇒ Object
Returns the value of attribute last_message_timestamp.
8 9 10 |
# File 'lib/thread.rb', line 8 def end |
#message_ids ⇒ Object
Returns the value of attribute message_ids.
12 13 14 |
# File 'lib/thread.rb', line 12 def end |
#participants ⇒ Object
Returns the value of attribute participants.
7 8 9 |
# File 'lib/thread.rb', line 7 def participants @participants end |
#snippet ⇒ Object
Returns the value of attribute snippet.
10 11 12 |
# File 'lib/thread.rb', line 10 def snippet @snippet end |
#subject ⇒ Object
Returns the value of attribute subject.
6 7 8 |
# File 'lib/thread.rb', line 6 def subject @subject end |
#tags ⇒ Object
Returns the value of attribute tags.
11 12 13 |
# File 'lib/thread.rb', line 11 def end |
Instance Method Details
#archive! ⇒ Object
44 45 46 |
# File 'lib/thread.rb', line 44 def archive! (['archive'], ['inbox']) end |
#drafts ⇒ Object
25 26 27 |
# File 'lib/thread.rb', line 25 def drafts @drafts ||= RestfulModelCollection.new(Draft, @_api, @namespace, {:thread=>@id}) end |
#inflate(json) ⇒ Object
15 16 17 18 19 |
# File 'lib/thread.rb', line 15 def inflate(json) super = json[:messages] draft_ids = json[:drafts] end |
#mark_as_read! ⇒ Object
36 37 38 |
# File 'lib/thread.rb', line 36 def mark_as_read! ([], ['unread']) end |
#mark_as_seen! ⇒ Object
40 41 42 |
# File 'lib/thread.rb', line 40 def mark_as_seen! ([], ['unseen']) end |
#messages ⇒ Object
21 22 23 |
# File 'lib/thread.rb', line 21 def ||= RestfulModelCollection.new(Message, @_api, @namespace, {:thread=>@id}) end |
#star! ⇒ Object
52 53 54 |
# File 'lib/thread.rb', line 52 def star! (['starred'], ['']) end |
#unarchive! ⇒ Object
48 49 50 |
# File 'lib/thread.rb', line 48 def unarchive! (['inbox'], ['archive']) end |
#unstar! ⇒ Object
56 57 58 |
# File 'lib/thread.rb', line 56 def unstar! ([], ['starred']) end |
#update_tags!(tags_to_add = [], tags_to_remove = []) ⇒ Object
29 30 31 32 33 34 |
# File 'lib/thread.rb', line 29 def ( = [], = []) update('PUT', '', { :add_tags => , :remove_tags => }) end |