Class: Mihari::Structs::ZoomEye::Response

Inherits:
Dry::Struct
  • Object
show all
Defined in:
lib/mihari/structs/zoomeye.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#dataArray<Datanum> (readonly)

Returns:



47
# File 'lib/mihari/structs/zoomeye.rb', line 47

attribute :data, Types.Array(Datanum)

#totalInteger (readonly)

Returns:

  • (Integer)


51
# File 'lib/mihari/structs/zoomeye.rb', line 51

attribute :total, Types::Int

Class Method Details

.from_dynamic!(d) ⇒ Object

Parameters:

  • d (Hash)


64
65
66
67
68
69
70
# File 'lib/mihari/structs/zoomeye.rb', line 64

def from_dynamic!(d)
  d = Types::Hash[d]
  new(
    data: d.fetch("data").map { |x| Datanum.from_dynamic!(x) },
    total: d.fetch("total")
  )
end

Instance Method Details

#artifactsArray<Mihari::Models::Artifact>

Returns:



56
57
58
# File 'lib/mihari/structs/zoomeye.rb', line 56

def artifacts
  data.map(&:artifacts).flatten
end