Sha256: 1482bf1a4788ef0b96840ea7e74d490a0d387b40fbd7b93c6a9829f2965022d9

Contents?: true

Size: 592 Bytes

Versions: 25

Compression:

Stored size: 592 Bytes

Contents

# frozen_string_literal: true

module Mihari
  class Artifact
    attr_reader :data

    #
    # @param [String] data
    # @param [String, nil] message
    #
    def initialize(data, message: nil)
      @data = data
      @message = message
    end

    # @return [String, nil]
    def data_type
      TypeChecker.type data
    end

    # @return [String]
    def message
      @mesasge || data
    end

    # @return [true, false]
    def valid?
      !data_type.nil?
    end

    # @return [Hash]
    def to_h
      { data: data, data_type: data_type, message: message }
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
mihari-0.17.5 lib/mihari/artifact.rb
mihari-0.17.4 lib/mihari/artifact.rb
mihari-0.17.3 lib/mihari/artifact.rb
mihari-0.17.2 lib/mihari/artifact.rb
mihari-0.17.1 lib/mihari/artifact.rb
mihari-0.17.0 lib/mihari/artifact.rb
mihari-0.16.0 lib/mihari/artifact.rb
mihari-0.15.0 lib/mihari/artifact.rb
mihari-0.14.0 lib/mihari/artifact.rb
mihari-0.13.2 lib/mihari/artifact.rb
mihari-0.13.1 lib/mihari/artifact.rb
mihari-0.13.0 lib/mihari/artifact.rb
mihari-0.12.0 lib/mihari/artifact.rb
mihari-0.11.0 lib/mihari/artifact.rb
mihari-0.10.0 lib/mihari/artifact.rb
mihari-0.9.1 lib/mihari/artifact.rb
mihari-0.9.0 lib/mihari/artifact.rb
mihari-0.8.2 lib/mihari/artifact.rb
mihari-0.8.1 lib/mihari/artifact.rb
mihari-0.8.0 lib/mihari/artifact.rb