Sha256: 299c1d15e0ee1664f34fae452e9b6c8c656ea2d742df39676a166d49782f0807

Contents?: true

Size: 707 Bytes

Versions: 130

Compression:

Stored size: 707 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, "EnvelopeFromElement can not parse |#{string}|\nReason was: #{parser.failure_reason}\n"
      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

130 entries across 100 versions & 6 rubygems

Version Path
depengine-0.0.31 etc/isolate/ruby-1.8/gems/mail-2.2.5/lib/mail/elements/envelope_from_element.rb
depengine-0.0.31 etc/isolate/jruby-1.8/gems/mail-2.2.5/lib/mail/elements/envelope_from_element.rb
depengine-0.0.30 etc/isolate/ruby-1.8/gems/mail-2.2.5/lib/mail/elements/envelope_from_element.rb
depengine-0.0.30 etc/isolate/jruby-1.8/gems/mail-2.2.5/lib/mail/elements/envelope_from_element.rb
depengine-0.0.29 etc/isolate/jruby-1.8/gems/mail-2.2.5/lib/mail/elements/envelope_from_element.rb
depengine-0.0.29 etc/isolate/ruby-1.8/gems/mail-2.2.5/lib/mail/elements/envelope_from_element.rb
depengine-0.0.28 etc/isolate/jruby-1.8/gems/mail-2.2.5/lib/mail/elements/envelope_from_element.rb
depengine-0.0.28 etc/isolate/ruby-1.8/gems/mail-2.2.5/lib/mail/elements/envelope_from_element.rb
depengine-0.0.27 etc/isolate/ruby-1.8/gems/mail-2.2.5/lib/mail/elements/envelope_from_element.rb
depengine-0.0.27 etc/isolate/jruby-1.8/gems/mail-2.2.5/lib/mail/elements/envelope_from_element.rb
depengine-0.0.26 etc/isolate/jruby-1.8/gems/mail-2.2.5/lib/mail/elements/envelope_from_element.rb
depengine-0.0.26 etc/isolate/ruby-1.8/gems/mail-2.2.5/lib/mail/elements/envelope_from_element.rb
depengine-0.0.25 etc/isolate/ruby-1.8/gems/mail-2.2.5/lib/mail/elements/envelope_from_element.rb
depengine-0.0.25 etc/isolate/jruby-1.8/gems/mail-2.2.5/lib/mail/elements/envelope_from_element.rb
depengine-0.0.24 etc/isolate/jruby-1.8/gems/mail-2.2.5/lib/mail/elements/envelope_from_element.rb
depengine-0.0.24 etc/isolate/ruby-1.8/gems/mail-2.2.5/lib/mail/elements/envelope_from_element.rb
depengine-0.0.23 etc/isolate/jruby-1.8/gems/mail-2.2.5/lib/mail/elements/envelope_from_element.rb
depengine-0.0.23 etc/isolate/ruby-1.8/gems/mail-2.2.5/lib/mail/elements/envelope_from_element.rb
depengine-0.0.22 etc/isolate/jruby-1.8/gems/mail-2.2.5/lib/mail/elements/envelope_from_element.rb
depengine-0.0.22 etc/isolate/ruby-1.8/gems/mail-2.2.5/lib/mail/elements/envelope_from_element.rb