Class: Mihari::Structs::ZoomEye::Datanum

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#domainString? (readonly)

Returns:

  • (String, nil)


13
# File 'lib/mihari/structs/zoomeye.rb', line 13

attribute :domain, Types::String.optional

#ipString (readonly)

Returns:

  • (String)


9
# File 'lib/mihari/structs/zoomeye.rb', line 9

attribute :ip, Types::String.optional

#metadataHash (readonly)

Returns:

  • (Hash)


21
# File 'lib/mihari/structs/zoomeye.rb', line 21

attribute :metadata, Types::Hash

#urlString (readonly)

Returns:

  • (String)


17
# File 'lib/mihari/structs/zoomeye.rb', line 17

attribute :url, Types::String.optional

Class Method Details

.from_dynamic!(d) ⇒ Object

Parameters:

  • d (Hash)


27
28
29
30
31
32
33
34
35
# File 'lib/mihari/structs/zoomeye.rb', line 27

def from_dynamic!(d)
  d = Types::Hash[d]
  new(
    domain: d["domain"],
    ip: d["ip"],
    url: d["url"],
    metadata: d
  )
end

Instance Method Details

#artifactsObject



38
39
40
41
# File 'lib/mihari/structs/zoomeye.rb', line 38

def artifacts
  values = [url, domain, ip].compact
  values.map { |value| Mihari::Models::Artifact.new(data: value, metadata:) }
end