lib/mihari/structs/onyphe.rb in mihari-5.6.2 vs lib/mihari/structs/onyphe.rb in mihari-5.7.0
- old
+ new
@@ -4,44 +4,28 @@
module Structs
module Onyphe
class Result < Dry::Struct
include Mixins::AutonomousSystem
+ # @!attribute [r] asn
+ # @return [String]
attribute :asn, Types::String
+
+ # @!attribute [r] country_code
+ # @return [String, nll]
attribute :country_code, Types::String.optional
- attribute :ip, Types::String
- attribute :metadata, Types::Hash
- #
- # @return [String]
- #
- def asn
- attributes[:asn]
- end
+ # @!attribute [r] ip
+ # @return [String]
- #
- # @return [String, nil]
- #
- def country_code
- attributes[:country_code]
- end
+ attribute :ip, Types::String
- #
- # @return [String]
- #
- def ip
- attributes[:ip]
- end
+ # @!attribute [r] metadata
+ # @return [Hash]
+ attribute :metadata, Types::Hash
#
- # @return [Hash]
- #
- def metadata
- attributes[:metadata]
- end
-
- #
# @return [Mihari::Models::Artifact]
#
def artifact
Mihari::Models::Artifact.new(
data: ip,
@@ -88,65 +72,36 @@
end
end
end
class Response < Dry::Struct
+ # @!attribute [r] count
+ # @return [Integer]
attribute :count, Types::Int
+
+ # @!attribute [r] error
+ # @return [Integer]
attribute :error, Types::Int
+
+ # @!attribute [r] max_page
+ # @return [Integer]
attribute :max_page, Types::Int
+
+ # @!attribute [r] page
+ # @return [Integer]
attribute :page, Types::Int
+
+ # @!attribute [r] results
+ # @return [Array<Result>]
attribute :results, Types.Array(Result)
+
+ # @!attribute [r] status
+ # @return [String]
attribute :status, Types::String
- attribute :total, Types::Int
- #
- # @return [Integer]
- #
- def count
- attributes[:count]
- end
-
- #
- # @return [Integer]
- #
- def error
- attributes[:error]
- end
-
- #
- # @return [Integer]
- #
- def max_page
- attributes[:max_page]
- end
-
- #
- # @return [Integer]
- #
- def page
- attributes[:page]
- end
-
- #
- # @return [Array<Result>]
- #
- def results
- attributes[:results]
- end
-
- #
- # @return [String]
- #
- def status
- attributes[:status]
- end
-
- #
- # @return [Integer]
- #
- def total
- attributes[:total]
- end
+ # @!attribute [r] total
+ # @return [Integer]
+ attribute :total, Types::Int
#
# @return [Array<Mihari::Models::Artifact>]
#
def artifacts