Class: Rounders::Mail

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/rounders/mail.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(mail) ⇒ Mail

Returns a new instance of Mail.



53
54
55
# File 'lib/rounders/mail.rb', line 53

def initialize(mail)
  @mail = mail
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object (private)



71
72
73
74
75
76
77
# File 'lib/rounders/mail.rb', line 71

def method_missing(method, *args, &block)
  if mail.respond_to?(method)
    mail.public_send(method, *args, &block)
  else
    super
  end
end

Instance Attribute Details

#mailObject (readonly)

Returns the value of attribute mail.



4
5
6
# File 'lib/rounders/mail.rb', line 4

def mail
  @mail
end

Instance Method Details

#textObject



57
58
59
60
61
62
63
# File 'lib/rounders/mail.rb', line 57

def text
  if mail.multipart?
    mail.text_part.decoded
  else
    mail.decoded
  end
end