Class: Mihari::Structs::GreyNoise::Response

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#completeBoolean (readonly)

Returns:

  • (Boolean)


96
# File 'lib/mihari/structs/greynoise.rb', line 96

attribute :complete, Types::Bool

#countInteger (readonly)

Returns:

  • (Integer)


100
# File 'lib/mihari/structs/greynoise.rb', line 100

attribute :count, Types::Int

#dataArray<Datnum> (readonly)

Returns:

  • (Array<Datnum>)


104
# File 'lib/mihari/structs/greynoise.rb', line 104

attribute :data, Types.Array(Datum)

#messageString (readonly)

Returns:

  • (String)


108
# File 'lib/mihari/structs/greynoise.rb', line 108

attribute :message, Types::String

#queryString (readonly)

Returns:

  • (String)


112
# File 'lib/mihari/structs/greynoise.rb', line 112

attribute :query, Types::String

#scrollString? (readonly)

Returns:

  • (String, nil)


116
# File 'lib/mihari/structs/greynoise.rb', line 116

attribute :scroll, Types::String.optional

Class Method Details

.from_dynamic!(d) ⇒ Object

Parameters:

  • d (Hash)


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

#artifactsArray<Mihari::Models::Artifact>

Returns:



121
122
123
# File 'lib/mihari/structs/greynoise.rb', line 121

def artifacts
  data.map(&:artifact)
end