Class: Mail::PhraseList
- Inherits:
-
Object
- Object
- Mail::PhraseList
- Includes:
- Utilities
- Defined in:
- lib/mail/elements/phrase_list.rb
Instance Method Summary collapse
-
#initialize(string) ⇒ PhraseList
constructor
A new instance of PhraseList.
- #phrases ⇒ Object
Methods included from Utilities
Constructor Details
#initialize(string) ⇒ PhraseList
Returns a new instance of PhraseList.
7 8 9 10 11 12 13 14 |
# File 'lib/mail/elements/phrase_list.rb', line 7 def initialize(string) parser = Mail::PhraseListsParser.new if tree = parser.parse(string) @phrases = tree.phrases else raise Mail::Field::ParseError, "PhraseList can not parse |#{string}|\nReason was: #{parser.failure_reason}\n" end end |
Instance Method Details
#phrases ⇒ Object
16 17 18 |
# File 'lib/mail/elements/phrase_list.rb', line 16 def phrases @phrases.map { |p| unquote(p.text_value) } end |