Class: Mihari::Structs::Fofa::Response

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#errmsgString? (readonly)

Returns:

  • (String, nil)


13
# File 'lib/mihari/structs/fofa.rb', line 13

attribute? :errmsg, Types::String.optional

#errorBoolean (readonly)

Returns:

  • (Boolean)


9
# File 'lib/mihari/structs/fofa.rb', line 9

attribute :error, Types::Bool

#modeString? (readonly)

Returns:

  • (String, nil)


25
# File 'lib/mihari/structs/fofa.rb', line 25

attribute? :mode, Types::String.optional

#pageInteger? (readonly)

Returns:

  • (Integer, nil)


21
# File 'lib/mihari/structs/fofa.rb', line 21

attribute? :page, Types::Int.optional

#queryString? (readonly)

Returns:

  • (String, nil)


29
# File 'lib/mihari/structs/fofa.rb', line 29

attribute? :query, Types::String.optional

#resultsArray<String>? (readonly)

Returns:

  • (Array<String>, nil)


33
# File 'lib/mihari/structs/fofa.rb', line 33

attribute? :results, Types.Array(Types.Array(Types::String)).optional

#sizeInteger? (readonly)

Returns:

  • (Integer, nil)


17
# File 'lib/mihari/structs/fofa.rb', line 17

attribute? :size, Types::Int.optional

Class Method Details

.from_dynamic!(d) ⇒ Object

Parameters:

  • d (Hash)


39
40
41
42
43
44
45
46
47
48
49
# File 'lib/mihari/structs/fofa.rb', line 39

def from_dynamic!(d)
  new(
    error: d.fetch("error"),
    errmsg: d["errmsg"],
    size: d["size"],
    page: d["page"],
    mode: d["mode"],
    query: d["query"],
    results: d["results"]
  )
end