Exception: PgObjects::DependencyNotExistError

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

Overview

Raised when a declared dependency matches no loaded object. Carries the file that declared the dependency via referrer and includes it in the message. Also accepts a bare name for compatibility.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(dep_name = nil, referrer: nil) ⇒ DependencyNotExistError

Returns a new instance of DependencyNotExistError.



48
49
50
51
52
53
# File 'lib/pg_objects.rb', line 48

def initialize(dep_name = nil, referrer: nil)
  @referrer = referrer
  message = dep_name.to_s
  message += " (referenced by #{referrer})" unless referrer.to_s.empty?
  message.empty? ? super() : super(message)
end

Instance Attribute Details

#referrerObject (readonly)

Returns the value of attribute referrer.



46
47
48
# File 'lib/pg_objects.rb', line 46

def referrer
  @referrer
end