Class: Mihari::Structs::BinaryEdge::Response
- Inherits:
-
Dry::Struct
- Object
- Dry::Struct
- Mihari::Structs::BinaryEdge::Response
- Defined in:
- lib/mihari/structs/binaryedge.rb
Instance Attribute Summary collapse
- #events ⇒ Array<Event> readonly
- #page ⇒ Integer readonly
- #pagesize ⇒ Integer readonly
- #total ⇒ Integer readonly
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#events ⇒ Array<Event> (readonly)
57 |
# File 'lib/mihari/structs/binaryedge.rb', line 57 attribute :events, Types.Array(Event) |
#page ⇒ Integer (readonly)
45 |
# File 'lib/mihari/structs/binaryedge.rb', line 45 attribute :page, Types::Int |
#pagesize ⇒ Integer (readonly)
49 |
# File 'lib/mihari/structs/binaryedge.rb', line 49 attribute :pagesize, Types::Int |
#total ⇒ Integer (readonly)
53 |
# File 'lib/mihari/structs/binaryedge.rb', line 53 attribute :total, Types::Int |
Class Method Details
.from_dynamic!(d) ⇒ Object
70 71 72 73 74 75 76 77 78 |
# File 'lib/mihari/structs/binaryedge.rb', line 70 def from_dynamic!(d) d = Types::Hash[d] new( page: d.fetch("page"), pagesize: d.fetch("pagesize"), total: d.fetch("total"), events: d.fetch("events").map { |x| Event.from_dynamic!(x) } ) end |
Instance Method Details
#artifacts ⇒ Array<Artifact>
62 63 64 |
# File 'lib/mihari/structs/binaryedge.rb', line 62 def artifacts events.map { |event| Models::Artifact.new(data: event.target.ip) } end |