Class: Mihari::Structs::Onyphe::Response
- Inherits:
-
Dry::Struct
- Object
- Dry::Struct
- Mihari::Structs::Onyphe::Response
- Defined in:
- lib/mihari/structs/onyphe.rb
Instance Attribute Summary collapse
- #count ⇒ Integer readonly
- #error ⇒ Integer readonly
- #max_page ⇒ Integer readonly
- #page ⇒ Integer readonly
- #results ⇒ Array<Result> readonly
- #status ⇒ String readonly
- #total ⇒ Integer readonly
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#count ⇒ Integer (readonly)
77 |
# File 'lib/mihari/structs/onyphe.rb', line 77 attribute :count, Types::Int |
#error ⇒ Integer (readonly)
81 |
# File 'lib/mihari/structs/onyphe.rb', line 81 attribute :error, Types::Int |
#max_page ⇒ Integer (readonly)
85 |
# File 'lib/mihari/structs/onyphe.rb', line 85 attribute :max_page, Types::Int |
#page ⇒ Integer (readonly)
89 |
# File 'lib/mihari/structs/onyphe.rb', line 89 attribute :page, Types::Int |
#results ⇒ Array<Result> (readonly)
93 |
# File 'lib/mihari/structs/onyphe.rb', line 93 attribute :results, Types.Array(Result) |
#status ⇒ String (readonly)
97 |
# File 'lib/mihari/structs/onyphe.rb', line 97 attribute :status, Types::String |
#total ⇒ Integer (readonly)
101 |
# File 'lib/mihari/structs/onyphe.rb', line 101 attribute :total, Types::Int |
Class Method Details
.from_dynamic!(d) ⇒ Object
114 115 116 117 118 119 120 121 122 123 124 125 |
# File 'lib/mihari/structs/onyphe.rb', line 114 def from_dynamic!(d) d = Types::Hash[d] new( count: d.fetch("count"), error: d.fetch("error"), max_page: d.fetch("max_page"), page: d.fetch("page").to_i, results: d.fetch("results").map { |x| Result.from_dynamic!(x) }, status: d.fetch("status"), total: d.fetch("total") ) end |
Instance Method Details
#artifacts ⇒ Array<Mihari::Models::Artifact>
106 107 108 |
# File 'lib/mihari/structs/onyphe.rb', line 106 def artifacts results.map(&:artifact) end |