Class: Gmail::Thread

Inherits:
APIResource show all
Includes:
Base::Delete, Base::Get, Base::List, Base::Modify, Base::Trash
Defined in:
lib/gmail/thread.rb

Instance Method Summary collapse

Methods included from Base::Trash

included, #trash, #untrash

Methods included from Base::Modify

#archive, #archive!, #mark_as_read, #mark_as_read!, #mark_as_unread, #mark_as_unread!, #modify, #modify!, #star, #star!, #unarchive, #unarchive!, #unstar, #unstar!

Methods included from Base::Get

included

Methods included from Base::Delete

#delete, included

Methods included from Base::List

included

Methods inherited from APIResource

base_method, class_name

Methods inherited from GmailObject

#[], #[]=, #as_json, #detailed, #initialize, #inspect, #refresh, #to_hash, #to_json, #to_s, #values

Constructor Details

This class inherits a constructor from Gmail::GmailObject

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Gmail::GmailObject

Instance Method Details

#messagesObject



9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/gmail/thread.rb', line 9

def messages

  if @values.messages.is_a? Array
    if @values.messages.first.is_a? Message
      @values.messages
    else
      @values.messages = Util.convert_to_gmail_object(to_hash[:messages], key="message")
    end
  else
    self.detailed!
    messages
  end

end

#sent_messagesObject



31
32
33
34
35
# File 'lib/gmail/thread.rb', line 31

def sent_messages

  messages.select{|m| m.sent?}

end

#unread_messagesObject



24
25
26
27
28
# File 'lib/gmail/thread.rb', line 24

def unread_messages

  messages.select{|m| m.unread?}

end