Sha256: 365d74e37df3e82abc88ca52460c1f29aaa63b2af6e1d49671bf06a30a8993ae
Contents?: true
Size: 679 Bytes
Versions: 23
Compression:
Stored size: 679 Bytes
Contents
module Foobara module Value class DataError < Error class << self def category :data end end def initialize(message: nil, symbol: nil, context: nil, path: nil) args = { message:, symbol:, context:, path: }.compact super(**args.merge(category: self.class.category)) end def attribute_name # TODO: feels awkward... something is not right # how is path actually set? path.last || context[:attribute_name] end def eql?(other) # TODO: this doesn't feel right at all... super && other.is_a?(DataError) && path == other.path end end end end
Version data entries
23 entries across 23 versions & 1 rubygems