Class: Mihari::Structs::VirusTotalIntelligence::Datum
- Inherits:
-
Dry::Struct
- Object
- Dry::Struct
- Mihari::Structs::VirusTotalIntelligence::Datum
- Defined in:
- lib/mihari/structs/virustotal_intelligence.rb
Instance Attribute Summary collapse
- #context_attributes ⇒ ContextAttributes? readonly
- #id ⇒ String readonly
- #metadata ⇒ Hash readonly
- #type ⇒ String readonly
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#context_attributes ⇒ ContextAttributes? (readonly)
33 |
# File 'lib/mihari/structs/virustotal_intelligence.rb', line 33 attribute :context_attributes, ContextAttributes.optional |
#id ⇒ String (readonly)
29 |
# File 'lib/mihari/structs/virustotal_intelligence.rb', line 29 attribute :id, Types::String |
Class Method Details
.from_dynamic!(d) ⇒ Object
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
# File 'lib/mihari/structs/virustotal_intelligence.rb', line 66 def from_dynamic!(d) d = Types::Hash[d] context_attributes = nil if d.key?("context_attributes") context_attributes = ContextAttributes.from_dynamic!(d.fetch("context_attributes")) end new( type: d.fetch("type"), id: d.fetch("id"), context_attributes:, metadata: d ) end |
Instance Method Details
#artifact ⇒ Mihari::Models::Artifact
58 59 60 |
# File 'lib/mihari/structs/virustotal_intelligence.rb', line 58 def artifact Models::Artifact.new(data: value, metadata:) end |
#value ⇒ String?
42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/mihari/structs/virustotal_intelligence.rb', line 42 def value case type when "file" id when "url" context_attributes&.url when "domain" id when "ip_address" id end end |