Class: Mihari::Structs::Urlscan::Result
- Inherits:
-
Dry::Struct
- Object
- Dry::Struct
- Mihari::Structs::Urlscan::Result
- Defined in:
- lib/mihari/structs/urlscan.rb
Instance Attribute Summary collapse
- #metadata ⇒ Hash readonly
- #page ⇒ Page readonly
- #pid ⇒ String readonly
- #sort ⇒ Array<String, Integer> readonly
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#metadata ⇒ Hash (readonly)
49 |
# File 'lib/mihari/structs/urlscan.rb', line 49 attribute :metadata, Types::Hash |
#page ⇒ Page (readonly)
37 |
# File 'lib/mihari/structs/urlscan.rb', line 37 attribute :page, Page |
#pid ⇒ String (readonly)
41 |
# File 'lib/mihari/structs/urlscan.rb', line 41 attribute :id, Types::String |
#sort ⇒ Array<String, Integer> (readonly)
45 |
# File 'lib/mihari/structs/urlscan.rb', line 45 attribute :sort, Types.Array(Types::String | Types::Int) |
Class Method Details
.from_dynamic!(d) ⇒ Object
63 64 65 66 67 68 69 70 71 |
# File 'lib/mihari/structs/urlscan.rb', line 63 def from_dynamic!(d) d = Types::Hash[d] new( page: Page.from_dynamic!(d.fetch("page")), id: d.fetch("_id"), sort: d.fetch("sort"), metadata: d ) end |
Instance Method Details
#artifacts ⇒ Array<Mihari::Models::Artifact>
54 55 56 57 |
# File 'lib/mihari/structs/urlscan.rb', line 54 def artifacts values = [page.url, page.domain, page.ip].compact values.map { |value| Mihari::Models::Artifact.new(data: value, metadata:) } end |