Module: SmartIoC

Defined in:
lib/smart_ioc.rb,
lib/smart_ioc/version.rb,
lib/smart_ioc/container.rb

Defined Under Namespace

Modules: Args, Errors, Iocify, Scopes Classes: BeanDefinition, BeanDefinitionsStorage, BeanDependency, BeanFactory, BeanFileLoader, BeanLocations, BeanLocator, Container, ExtraPackageContexts, InjectMetadata, Railtie

Constant Summary collapse

VERSION =
"0.2.0"

Class Method Summary collapse

Class Method Details

.clearObject

Full clear of data (mostly for tests)



47
48
49
50
# File 'lib/smart_ioc.rb', line 47

def clear
  BeanLocations.clear
  Container.clear
end

.containerObject



52
53
54
# File 'lib/smart_ioc.rb', line 52

def container
  Container.get_instance
end

.find_package_beans(package_name, dir) ⇒ Object

Returns nil.

Parameters:

  • package_name (String or Symbol)

    package name for bean definitions

  • dir (String)

    absolute path with bean definitions

Returns:

  • nil



35
36
37
38
39
# File 'lib/smart_ioc.rb', line 35

def find_package_beans(package_name, dir)
  bean_locator = SmartIoC::BeanLocator.new
  bean_locator.locate_beans(package_name.to_sym, dir)
  nil
end

.load_all_beansObject

Load all beans (usually required for production env)



42
43
44
# File 'lib/smart_ioc.rb', line 42

def load_all_beans
  BeanLocations.load_all
end