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
rails-uploader-0.0.1 vendor/bundle/ruby/1.9.1/gems/mail-2.4.4/lib/mail/elements/envelope_from_element.rb
challah-0.6.0 vendor/bundle/gems/mail-2.4.4/lib/mail/elements/envelope_from_element.rb
challah-0.6.0 vendor/bundle/gems/mail-2.4.1/lib/mail/elements/envelope_from_element.rb
challah-0.5.4 vendor/bundle/gems/mail-2.4.1/lib/mail/elements/envelope_from_element.rb
challah-0.5.3 vendor/bundle/gems/mail-2.4.1/lib/mail/elements/envelope_from_element.rb
challah-0.5.2 vendor/bundle/gems/mail-2.4.1/lib/mail/elements/envelope_from_element.rb
mail-2.4.4 lib/mail/elements/envelope_from_element.rb
mail-2.4.3 lib/mail/elements/envelope_from_element.rb
challah-0.5.1 vendor/bundle/gems/mail-2.4.1/lib/mail/elements/envelope_from_element.rb
challah-0.5.0 vendor/bundle/gems/mail-2.4.1/lib/mail/elements/envelope_from_element.rb
challah-0.4.1 vendor/bundle/gems/mail-2.4.1/lib/mail/elements/envelope_from_element.rb
challah-0.4.0 vendor/bundle/gems/mail-2.4.1/lib/mail/elements/envelope_from_element.rb
challah-0.3.5 vendor/bundle/gems/mail-2.4.1/lib/mail/elements/envelope_from_element.rb
challah-0.3.4 vendor/bundle/gems/mail-2.4.1/lib/mail/elements/envelope_from_element.rb
challah-0.3.3 vendor/bundle/gems/mail-2.4.1/lib/mail/elements/envelope_from_element.rb
challah-0.3.2 vendor/bundle/gems/mail-2.4.1/lib/mail/elements/envelope_from_element.rb
challah-0.3.1 vendor/bundle/gems/mail-2.4.1/lib/mail/elements/envelope_from_element.rb
challah-0.3.0 vendor/bundle/gems/mail-2.4.1/lib/mail/elements/envelope_from_element.rb
challah-0.2.1 vendor/bundle/gems/mail-2.4.1/lib/mail/elements/envelope_from_element.rb
challah-0.2.0 vendor/bundle/gems/mail-2.4.1/lib/mail/elements/envelope_from_element.rb