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
#created_at, #id, #namespace_id
Instance Method Summary collapse
- #archive! ⇒ Object
- #drafts ⇒ 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, #inflate, #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
38 39 40 |
# File 'lib/thread.rb', line 38 def archive! (['archive'], ['inbox']) end |
#drafts ⇒ Object
19 20 21 |
# File 'lib/thread.rb', line 19 def drafts @drafts ||= RestfulModelCollection.new(Draft, @_api, @namespace_id, {:thread_id=>@id}) end |
#mark_as_read! ⇒ Object
30 31 32 |
# File 'lib/thread.rb', line 30 def mark_as_read! ([], ['unread']) end |
#mark_as_seen! ⇒ Object
34 35 36 |
# File 'lib/thread.rb', line 34 def mark_as_seen! ([], ['unseen']) end |
#messages ⇒ Object
15 16 17 |
# File 'lib/thread.rb', line 15 def ||= RestfulModelCollection.new(Message, @_api, @namespace_id, {:thread_id=>@id}) end |
#star! ⇒ Object
46 47 48 |
# File 'lib/thread.rb', line 46 def star! (['starred'], ['']) end |
#unarchive! ⇒ Object
42 43 44 |
# File 'lib/thread.rb', line 42 def unarchive! (['inbox'], ['archive']) end |
#unstar! ⇒ Object
50 51 52 |
# File 'lib/thread.rb', line 50 def unstar! ([], ['starred']) end |
#update_tags!(tags_to_add = [], tags_to_remove = []) ⇒ Object
23 24 25 26 27 28 |
# File 'lib/thread.rb', line 23 def ( = [], = []) update('PUT', '', { :add_tags => , :remove_tags => }) end |