Sha256: 27b3c9dd3698d3eb69162935636b857c7b050d7e691955af2093e0b41f53a6ff

Contents?: true

Size: 644 Bytes

Versions: 13

Compression:

Stored size: 644 Bytes

Contents

require 'apps/messenger/models/message'

module Spider; module Messenger
    
    class Email < Message
        class_table_inheritance :add_polymorphic => true
        element :from, String, :label => _("From")
        element :to, String, :label => _("To")
        element :headers, Text, :label => _("Headers")
        element :subject, String, :label => _("Subject"), :computed_from => [:headers]
        element :body, Text, :label => _("Body")
        
        def subject
            if (self.headers =~ /^Subject: (.+)$/)
                return $1
            end
            return ''
        end
                
    end
    
end; end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
spiderfw-0.5.13 apps/messenger/models/email.rb
spiderfw-0.5.12 apps/messenger/models/email.rb
spiderfw-0.5.11 apps/messenger/models/email.rb
spiderfw-0.5.10 apps/messenger/models/email.rb
spiderfw-0.5.9 apps/messenger/models/email.rb
spiderfw-0.5.7 apps/messenger/models/email.rb
spiderfw-0.5.6 apps/messenger/models/email.rb
spiderfw-0.5.5 apps/messenger/models/email.rb
spiderfw-0.5.4 apps/messenger/models/email.rb
spiderfw-0.5.3 apps/messenger/models/email.rb
spiderfw-0.5.2 apps/messenger/models/email.rb
spiderfw-0.5.1 apps/messenger/models/email.rb
spiderfw-0.5 apps/messenger/models/email.rb