Exception: Injectable::Container::Unresolvable

Inherits:
Exception
  • Object
show all
Defined in:
lib/injectable/container.rb

Overview

This error is raised when asking for an object out of the container that cannot be resolved.

Since:

  • 0.0.4

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(classes) ⇒ Unresolvable

Initialize the new error.

Examples:

Initialize the error.

Unresolvable.new([ Persistable, Saveable ])

Parameters:

  • classes (Array<Class>)

    The classes that were attempted to instantiate with.

Since:

  • 0.0.4



68
69
70
71
72
73
74
# File 'lib/injectable/container.rb', line 68

def initialize(classes)
  @classes = classes
  super(
    "Could not instantiate an object for any of: #{classes.join(", ")}. " +
    "Please ensure all required dependencies are in the container."
  )
end

Instance Attribute Details

#classesObject (readonly)

Since:

  • 0.0.4



57
58
59
# File 'lib/injectable/container.rb', line 57

def classes
  @classes
end

#classes The classes that were attempted to instantiate.(Theclassesthatwereattemptedtoinstantiate.) ⇒ Object (readonly)



57
# File 'lib/injectable/container.rb', line 57

attr_reader :classes