Method: Seasar::Container::S2ApplicationContext#register

Defined in:
lib/seasar/container/s2application-context.rb

#register(options = {}, &procedure) ⇒ Object

  • args

    1. Hash options component information

    2. Proc procedure constructor block of component

  • return

    • nil



163
164
165
166
167
168
169
170
171
172
# File 'lib/seasar/container/s2application-context.rb', line 163

def register(options = {}, &procedure)
  raise "can not register component_info to snapshot application context." if self.snapshot?
  info = ComponentInfoDef.new(options, &procedure)
  if options[:static] == true
    @@static_component_infos << info
  else
    @component_infos << info
  end
  return info
end