class Mail::KeywordsField - mail-2.5.4 Documentation

# class Mail::KeywordsField

### Constants

CAPITALIZED_FIELD
FIELD_NAME

### Public Class Methods

new(value = nil, charset = 'utf-8') click to toggle source
Calls superclass method

    # File lib/mail/fields/keywords_field.rb, line 9
    def initialize(value = nil, charset = 'utf-8')
      self.charset = charset
      super(CAPITALIZED_FIELD, strip_field(FIELD_NAME, value), charset)
      self.parse
      self
    end

### Public Instance Methods

decoded() click to toggle source

    # File lib/mail/fields/keywords_field.rb, line 34
    def decoded
      keywords.join(', ')
    end

default() click to toggle source

    # File lib/mail/fields/keywords_field.rb, line 38
    def default
      keywords
    end

encoded() click to toggle source

    # File lib/mail/fields/keywords_field.rb, line 30
    def encoded
      "#{CAPITALIZED_FIELD}: #{keywords.join(",\r\n ")}\r\n"
    end

keywords() click to toggle source

    # File lib/mail/fields/keywords_field.rb, line 26
    def keywords
      phrase_list.phrases
    end

parse(val = value) click to toggle source

    # File lib/mail/fields/keywords_field.rb, line 16
    def parse(val = value)
      unless val.blank?
        @phrase_list ||= PhraseList.new(value)
      end
    end

phrase_list() click to toggle source

    # File lib/mail/fields/keywords_field.rb, line 22
    def phrase_list
      @phrase_list ||= PhraseList.new(value)
    end