Class: Mihari::Structs::Shodan::InternetDBResponse
- Inherits:
-
Dry::Struct
- Object
- Dry::Struct
- Mihari::Structs::Shodan::InternetDBResponse
- Defined in:
- lib/mihari/structs/shodan.rb
Instance Attribute Summary collapse
- #cpes ⇒ Array<String> readonly
- #hostnames ⇒ Array<String> readonly
- #ip ⇒ String readonly
- #ports ⇒ Array<Integer> readonly
- #tags ⇒ Array<String> readonly
- #vulns ⇒ Array<String> readonly
Class Method Summary collapse
Instance Attribute Details
#cpes ⇒ Array<String> (readonly)
206 |
# File 'lib/mihari/structs/shodan.rb', line 206 attribute :cpes, Types.Array(Types::String) |
#hostnames ⇒ Array<String> (readonly)
210 |
# File 'lib/mihari/structs/shodan.rb', line 210 attribute :hostnames, Types.Array(Types::String) |
#ip ⇒ String (readonly)
198 |
# File 'lib/mihari/structs/shodan.rb', line 198 attribute :ip, Types::String |
#ports ⇒ Array<Integer> (readonly)
202 |
# File 'lib/mihari/structs/shodan.rb', line 202 attribute :ports, Types.Array(Types::Int) |
#tags ⇒ Array<String> (readonly)
214 |
# File 'lib/mihari/structs/shodan.rb', line 214 attribute :tags, Types.Array(Types::String) |
#vulns ⇒ Array<String> (readonly)
218 |
# File 'lib/mihari/structs/shodan.rb', line 218 attribute :vulns, Types.Array(Types::String) |
Class Method Details
.from_dynamic!(d) ⇒ Object
224 225 226 227 228 229 230 231 232 233 234 |
# File 'lib/mihari/structs/shodan.rb', line 224 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 |
.from_json!(json) ⇒ InternetDBResponse
241 242 243 |
# File 'lib/mihari/structs/shodan.rb', line 241 def from_json!(json) from_dynamic!(JSON.parse(json)) end |