Sha256: 9f4bc334d0fe6f1a7f3dab293b8d2db0f93ddb570b1e025958ac02e2c92d7db1

Contents?: true

Size: 1.34 KB

Versions: 17

Compression:

Stored size: 1.34 KB

Contents

# frozen_string_literal: true

module Mihari
  module Structs
    module Fofa
      class Response < Dry::Struct
        # @!attribute [r] error
        #   @return [Boolean]
        attribute :error, Types::Bool

        # @!attribute [r] errmsg
        #   @return [String, nil]
        attribute? :errmsg, Types::String.optional

        # @!attribute [r] size
        #   @return [Integer, nil]
        attribute? :size, Types::Int.optional

        # @!attribute [r] page
        #   @return [Integer, nil]
        attribute? :page, Types::Int.optional

        # @!attribute [r] mode
        #   @return [String, nil]
        attribute? :mode, Types::String.optional

        # @!attribute [r] query
        #   @return [String, nil]
        attribute? :query, Types::String.optional

        # @!attribute [r] results
        #   @return [Array<String>, nil]
        attribute? :results, Types.Array(Types.Array(Types::String)).optional

        class << self
          #
          # @param [Hash] d
          #
          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
        end
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
mihari-8.0.0 lib/mihari/structs/fofa.rb
mihari-7.6.4 lib/mihari/structs/fofa.rb
mihari-7.6.3 lib/mihari/structs/fofa.rb
mihari-7.6.2 lib/mihari/structs/fofa.rb
mihari-7.6.1 lib/mihari/structs/fofa.rb
mihari-7.6.0 lib/mihari/structs/fofa.rb
mihari-7.5.0 lib/mihari/structs/fofa.rb
mihari-7.4.0 lib/mihari/structs/fofa.rb
mihari-7.3.2 lib/mihari/structs/fofa.rb
mihari-7.3.1 lib/mihari/structs/fofa.rb
mihari-7.3.0 lib/mihari/structs/fofa.rb
mihari-7.2.0 lib/mihari/structs/fofa.rb
mihari-7.1.3 lib/mihari/structs/fofa.rb
mihari-7.1.2 lib/mihari/structs/fofa.rb
mihari-7.1.1 lib/mihari/structs/fofa.rb
mihari-7.1.0 lib/mihari/structs/fofa.rb
mihari-7.0.5 lib/mihari/structs/fofa.rb