Class: Mihari::Structs::GreyNoise::Response
- Inherits:
-
Dry::Struct
- Object
- Dry::Struct
- Mihari::Structs::GreyNoise::Response
- Defined in:
- lib/mihari/structs/greynoise.rb
Instance Attribute Summary collapse
- #complete ⇒ Boolean readonly
- #count ⇒ Integer readonly
- #data ⇒ Array<Datnum> readonly
- #message ⇒ String readonly
- #query ⇒ String readonly
- #scroll ⇒ String? readonly
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#complete ⇒ Boolean (readonly)
96 |
# File 'lib/mihari/structs/greynoise.rb', line 96 attribute :complete, Types::Bool |
#count ⇒ Integer (readonly)
100 |
# File 'lib/mihari/structs/greynoise.rb', line 100 attribute :count, Types::Int |
#data ⇒ Array<Datnum> (readonly)
104 |
# File 'lib/mihari/structs/greynoise.rb', line 104 attribute :data, Types.Array(Datum) |
#message ⇒ String (readonly)
108 |
# File 'lib/mihari/structs/greynoise.rb', line 108 attribute :message, Types::String |
Class Method Details
.from_dynamic!(d) ⇒ Object
129 130 131 132 133 134 135 136 137 138 139 |
# File 'lib/mihari/structs/greynoise.rb', line 129 def from_dynamic!(d) d = Types::Hash[d] new( complete: d.fetch("complete"), count: d.fetch("count"), data: d.fetch("data").map { |x| Datum.from_dynamic!(x) }, message: d.fetch("message"), query: d.fetch("query"), scroll: d["scroll"] ) end |
Instance Method Details
#artifacts ⇒ Array<Mihari::Models::Artifact>
121 122 123 |
# File 'lib/mihari/structs/greynoise.rb', line 121 def artifacts data.map(&:artifact) end |