Sha256: fa04a999edc2ea17a39c81f6f695968ec74e567998dcdcd80fab97ec0c42c741

Contents?: true

Size: 674 Bytes

Versions: 121

Compression:

Stored size: 674 Bytes

Contents

# encoding: utf-8
module Mail
  class EnvelopeFromElement
    
    include Mail::Utilities
    
    def initialize( string )
      parser = Mail::EnvelopeFromParser.new
      if @tree = parser.parse(string)
        @address = tree.addr_spec.text_value.strip
        @date_time = ::DateTime.parse("#{tree.ctime_date.text_value}")
      else
        raise Mail::Field::ParseError.new(EnvelopeFromElement, string, parser.failure_reason)
      end
    end
    
    def tree
      @tree
    end
    
    def date_time
      @date_time
    end
    
    def address
      @address
    end
    
    def to_s(*args)
      "#{@info}; #{@date_time.to_s(*args)}"
    end
    
  end
end

Version data entries

121 entries across 109 versions & 12 rubygems

Version Path
active_mailer-0.0.5 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/mail-2.4.4/lib/mail/elements/envelope_from_element.rb
active_mailer-0.0.4 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/mail-2.4.4/lib/mail/elements/envelope_from_element.rb
active_mailer-0.0.3 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/mail-2.4.4/lib/mail/elements/envelope_from_element.rb
challah-0.9.1.beta.3 vendor/bundle/gems/mail-2.4.4/lib/mail/elements/envelope_from_element.rb
devise_sociable-0.1.0 vendor/bundle/gems/mail-2.4.4/lib/mail/elements/envelope_from_element.rb
challah-0.9.1.beta vendor/bundle/gems/mail-2.4.4/lib/mail/elements/envelope_from_element.rb
sunrise-cms-0.5.0.rc1 vendor/bundle/ruby/1.9.1/gems/mail-2.4.4/lib/mail/elements/envelope_from_element.rb
challah-0.9.0 vendor/bundle/gems/mail-2.4.4/lib/mail/elements/envelope_from_element.rb
classiccms-0.6.9 vendor/bundle/gems/mail-2.4.4/lib/mail/elements/envelope_from_element.rb
mail-2.5.3 lib/mail/elements/envelope_from_element.rb
mail-2.5.2 lib/mail/elements/envelope_from_element.rb
challah-rolls-0.2.0 vendor/bundle/gems/challah-0.8.3/vendor/bundle/gems/mail-2.4.4/lib/mail/elements/envelope_from_element.rb
challah-rolls-0.2.0 vendor/bundle/gems/mail-2.4.4/lib/mail/elements/envelope_from_element.rb
challah-rolls-0.2.0 vendor/bundle/gems/challah-0.8.0.pre/vendor/bundle/gems/mail-2.4.4/lib/mail/elements/envelope_from_element.rb
challah-0.8.3 vendor/bundle/gems/mail-2.4.4/lib/mail/elements/envelope_from_element.rb
classiccms-0.6.8 vendor/bundle/gems/mail-2.4.4/lib/mail/elements/envelope_from_element.rb
classiccms-0.6.7 vendor/bundle/gems/mail-2.4.4/lib/mail/elements/envelope_from_element.rb
otherinbox-mail-2.4.4.20121031 lib/mail/elements/envelope_from_element.rb
classiccms-0.6.6 vendor/bundle/gems/mail-2.4.4/lib/mail/elements/envelope_from_element.rb
classiccms-0.6.5 vendor/bundle/gems/mail-2.4.4/lib/mail/elements/envelope_from_element.rb