Module: Mail::RFC2822::Address1

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

Instance Method Summary collapse

Instance Method Details

#commentsObject



2828
2829
2830
2831
2832
# File 'lib/mail/parsers/rfc2822.rb', line 2828

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

#dig_comments(comments, elements) ⇒ Object



2819
2820
2821
2822
2823
2824
2825
2826
# File 'lib/mail/parsers/rfc2822.rb', line 2819

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