Exception: PgObjects::AmbiguousDependencyError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/pg_objects.rb

Overview

Raised when a dependency name resolves to more than one object. Carries the matching objects' file paths via candidates and the file that declared the dependency via referrer; the message lists them all. Also accepts a bare name for compatibility.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(dep_name = nil, candidates: [], referrer: nil) ⇒ AmbiguousDependencyError

Returns a new instance of AmbiguousDependencyError.



13
14
15
16
17
18
# File 'lib/pg_objects.rb', line 13

def initialize(dep_name = nil, candidates: [], referrer: nil)
  @candidates = candidates
  @referrer = referrer
  message = build_message(dep_name)
  message.empty? ? super() : super(message)
end

Instance Attribute Details

#candidatesObject (readonly)

Returns the value of attribute candidates.



11
12
13
# File 'lib/pg_objects.rb', line 11

def candidates
  @candidates
end

#referrerObject (readonly)

Returns the value of attribute referrer.



11
12
13
# File 'lib/pg_objects.rb', line 11

def referrer
  @referrer
end