Class: ActiveStix::Artifact

Inherits:
ApplicationRecord show all
Defined in:
app/models/active_stix/artifact.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.create_from_eml(eml) ⇒ Object



14
15
16
17
18
19
20
21
# File 'app/models/active_stix/artifact.rb', line 14

def self.create_from_eml(eml)
  mail = Mail.new(eml)
  artifact = Artifact.new
  artifact.mime_type = mail.mime_type
  artifact.payload_bin = eml
  artifact.save
  artifact
end

Instance Method Details

#typeObject



8
9
10
# File 'app/models/active_stix/artifact.rb', line 8

def type
  return "artifact"
end