Sha256: 2242e875c140a1fb229bb8c74b79a2673949450a411bc4bfa08328fb0a7a6339
Contents?: true
Size: 1.11 KB
Versions: 15
Compression:
Stored size: 1.11 KB
Contents
require_relative '../../utils/hash' module Datadog module Core module Telemetry module V1 # Describes attributes for dependency object class Dependency using Core::Utils::Hash::Refinement ERROR_NIL_NAME_MESSAGE = ':name must not be nil'.freeze attr_reader \ :hash, :name, :version # @param name [String] Module name # @param version [String] Version of resolved module # @param hash [String] Dependency hash, in case `version` is not available def initialize(name:, version: nil, hash: nil) raise ArgumentError, ERROR_NIL_NAME_MESSAGE if name.nil? raise ArgumentError, 'if both :version and :hash exist, use :version only' if version && hash @hash = hash @name = name @version = version end def to_h hash = { hash: @hash, name: @name, version: @version } hash.compact! hash end end end end end end
Version data entries
15 entries across 15 versions & 1 rubygems