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
classiccms-0.7.5 vendor/bundle/gems/mail-2.4.4/lib/mail/elements/envelope_from_element.rb
classiccms-0.7.4 vendor/bundle/gems/mail-2.4.4/lib/mail/elements/envelope_from_element.rb
classiccms-0.7.3 vendor/bundle/gems/mail-2.4.4/lib/mail/elements/envelope_from_element.rb
active_mailer-0.0.10 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/mail-2.4.4/lib/mail/elements/envelope_from_element.rb
judge-2.0.5 vendor/bundle/ruby/2.1.0/gems/mail-2.4.4/lib/mail/elements/envelope_from_element.rb
classiccms-0.7.2 vendor/bundle/gems/mail-2.4.4/lib/mail/elements/envelope_from_element.rb
classiccms-0.7.1 vendor/bundle/gems/mail-2.4.4/lib/mail/elements/envelope_from_element.rb
active_mailer-0.0.9 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.8 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.7 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.6 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/mail-2.4.4/lib/mail/elements/envelope_from_element.rb
classiccms-0.7.0 vendor/bundle/gems/mail-2.4.4/lib/mail/elements/envelope_from_element.rb
challah-1.0.0.beta3 vendor/bundle/gems/mail-2.5.3/lib/mail/elements/envelope_from_element.rb
fc-webicons-0.0.4 vendor/bundle/ruby/1.9.1/gems/mail-2.5.3/lib/mail/elements/envelope_from_element.rb
challah-1.0.0.beta2 vendor/bundle/gems/mail-2.5.3/lib/mail/elements/envelope_from_element.rb
challah-1.0.0.beta vendor/bundle/gems/mail-2.5.3/lib/mail/elements/envelope_from_element.rb
challah-1.0.0.beta vendor/bundle/gems/mail-2.4.4/lib/mail/elements/envelope_from_element.rb
fc-webicons-0.0.3 vendor/bundle/ruby/1.9.1/gems/mail-2.5.3/lib/mail/elements/envelope_from_element.rb
fc-webicons-0.0.2 vendor/bundle/ruby/1.9.1/gems/mail-2.5.3/lib/mail/elements/envelope_from_element.rb
fc-webicons-0.0.1 vendor/bundle/ruby/1.9.1/gems/mail-2.5.3/lib/mail/elements/envelope_from_element.rb