Class: Mihari::Structs::HunterHow::ListItem

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#domainString (readonly)

Returns:

  • (String)


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

attribute :domain, Types::String

#ipString (readonly)

Returns:

  • (String)


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

attribute :ip, Types::String

#portInteger (readonly)

Returns:

  • (Integer)


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

attribute :port, Types::Int

Class Method Details

.from_dynamic!(d) ⇒ Object

Parameters:

  • d (Hash)


30
31
32
33
34
35
36
37
# File 'lib/mihari/structs/hunterhow.rb', line 30

def from_dynamic!(d)
  d = Types::Hash[d]
  new(
    domain: d.fetch("domain"),
    ip: d.fetch("ip"),
    port: d.fetch("port")
  )
end

Instance Method Details

#artifactMihari::Models::Artifact



22
23
24
# File 'lib/mihari/structs/hunterhow.rb', line 22

def artifact
  Models::Artifact.new(data: ip)
end