Module: Mail::RFC2822::Address1

Defined in:
lib/mail/parsers/rfc2822.rb

Instance Method Summary collapse

Instance Method Details

#commentsObject


2866
2867
2868
2869
2870
# File 'lib/mail/parsers/rfc2822.rb', line 2866

def comments
  comments = []
  dig_comments(comments, elements)
  comments
end

#dig_comments(comments, elements) ⇒ Object


2857
2858
2859
2860
2861
2862
2863
2864
# File 'lib/mail/parsers/rfc2822.rb', line 2857

def dig_comments(comments, elements)
  elements.each { |elem|
    if elem.respond_to?(:comment)
      comments << elem.comment
    end
    dig_comments(comments, elem.elements) if elem.elements
   }
end