Class: Mihari::Structs::Shodan::InternetDBResponse

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#cpesArray<String> (readonly)

Returns:

  • (Array<String>)


253
# File 'lib/mihari/structs/shodan.rb', line 253

attribute :cpes, Types.Array(Types::String)

#hostnamesArray<String> (readonly)

Returns:

  • (Array<String>)


257
# File 'lib/mihari/structs/shodan.rb', line 257

attribute :hostnames, Types.Array(Types::String)

#ipString (readonly)

Returns:

  • (String)


245
# File 'lib/mihari/structs/shodan.rb', line 245

attribute :ip, Types::String

#portsArray<Integer> (readonly)

Returns:

  • (Array<Integer>)


249
# File 'lib/mihari/structs/shodan.rb', line 249

attribute :ports, Types.Array(Types::Int)

#tagsArray<String> (readonly)

Returns:

  • (Array<String>)


261
# File 'lib/mihari/structs/shodan.rb', line 261

attribute :tags, Types.Array(Types::String)

#vulnsArray<String> (readonly)

Returns:

  • (Array<String>)


265
# File 'lib/mihari/structs/shodan.rb', line 265

attribute :vulns, Types.Array(Types::String)

Class Method Details

.from_dynamic!(d) ⇒ Object

Parameters:

  • d (Hash)


271
272
273
274
275
276
277
278
279
280
281
# File 'lib/mihari/structs/shodan.rb', line 271

def from_dynamic!(d)
  d = Types::Hash[d]
  new(
    ip: d.fetch("ip"),
    ports: d.fetch("ports"),
    cpes: d.fetch("cpes"),
    hostnames: d.fetch("hostnames"),
    tags: d.fetch("tags"),
    vulns: d.fetch("vulns")
  )
end