Class: Mihari::Structs::Censys::Result
- Inherits:
-
Dry::Struct
- Object
- Dry::Struct
- Mihari::Structs::Censys::Result
- Defined in:
- lib/mihari/structs/censys.rb
Instance Attribute Summary collapse
- #hits ⇒ Array<Hit> readonly
- #links ⇒ Links readonly
- #query ⇒ String readonly
- #total ⇒ Integer readonly
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#hits ⇒ Array<Hit> (readonly)
189 |
# File 'lib/mihari/structs/censys.rb', line 189 attribute :hits, Types.Array(Hit) |
#links ⇒ Links (readonly)
193 |
# File 'lib/mihari/structs/censys.rb', line 193 attribute :links, Links |
Class Method Details
.from_dynamic!(d) ⇒ Object
206 207 208 209 210 211 212 213 214 |
# File 'lib/mihari/structs/censys.rb', line 206 def from_dynamic!(d) d = Types::Hash[d] new( query: d.fetch("query"), total: d.fetch("total"), hits: d.fetch("hits", []).map { |x| Hit.from_dynamic!(x) }, links: Links.from_dynamic!(d.fetch("links")) ) end |
Instance Method Details
#artifacts ⇒ Array<Mihari::Models::Artifact>
198 199 200 |
# File 'lib/mihari/structs/censys.rb', line 198 def artifacts hits.map(&:artifact) end |