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)
187 |
# File 'lib/mihari/structs/censys.rb', line 187 attribute :hits, Types.Array(Hit) |
#links ⇒ Links (readonly)
191 |
# File 'lib/mihari/structs/censys.rb', line 191 attribute :links, Links |
#query ⇒ String (readonly)
179 |
# File 'lib/mihari/structs/censys.rb', line 179 attribute :query, Types::String |
#total ⇒ Integer (readonly)
183 |
# File 'lib/mihari/structs/censys.rb', line 183 attribute :total, Types::Int |
Class Method Details
.from_dynamic!(d) ⇒ Object
204 205 206 207 208 209 210 211 212 |
# File 'lib/mihari/structs/censys.rb', line 204 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>
196 197 198 |
# File 'lib/mihari/structs/censys.rb', line 196 def artifacts hits.map(&:artifact) end |