Class: Mihari::Structs::Urlscan::Result

Inherits:
Dry::Struct
  • Object
show all
Defined in:
lib/mihari/structs/urlscan.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#metadataHash (readonly)

Returns:

  • (Hash)


49
# File 'lib/mihari/structs/urlscan.rb', line 49

attribute :metadata, Types::Hash

#pagePage (readonly)

Returns:



37
# File 'lib/mihari/structs/urlscan.rb', line 37

attribute :page, Page

#pidString (readonly)

Returns:

  • (String)


41
# File 'lib/mihari/structs/urlscan.rb', line 41

attribute :id, Types::String

#sortArray<String, Integer> (readonly)

Returns:

  • (Array<String, Integer>)


45
# File 'lib/mihari/structs/urlscan.rb', line 45

attribute :sort, Types.Array(Types::String | Types::Int)

Class Method Details

.from_dynamic!(d) ⇒ Object

Parameters:

  • d (Hash)


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

#artifactsArray<Mihari::Models::Artifact>

Returns:



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