Module: RubyBeans

Defined in:
lib/ruby_beans.rb,
lib/ruby_beans/stub.rb,
lib/ruby_beans/cache.rb,
lib/ruby_beans/version.rb,
lib/ruby_beans/injector.rb,
lib/ruby_beans/container.rb

Defined Under Namespace

Modules: Injector, Stub Classes: Cache, Container

Constant Summary collapse

VERSION =
"0.1.1"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.main_containerObject

Returns the value of attribute main_container.



8
9
10
# File 'lib/ruby_beans.rb', line 8

def main_container
  @main_container
end

Class Method Details

.get_bean(name) ⇒ Object



10
11
12
13
14
15
16
17
# File 'lib/ruby_beans.rb', line 10

def get_bean(name)
  bean = RubyBeans::Cache.get(name)
  unless bean
    bean = main_container.send(name)
    RubyBeans::Cache.put(name, bean)
  end
  bean
end