Module: Helium::ClassMethods

Defined in:
lib/helium/initialization.rb

Instance Method Summary collapse

Instance Method Details

#after_initialize(&block) ⇒ Object



16
17
18
# File 'lib/helium/initialization.rb', line 16

def after_initialize(&block)
  initialization[:after] << block
end

#before_initialize(&block) ⇒ Object



12
13
14
# File 'lib/helium/initialization.rb', line 12

def before_initialize(&block)
  initialization[:before] << block
end

#initializationObject



20
21
22
23
24
25
# File 'lib/helium/initialization.rb', line 20

def initialization
  @initialization ||= {
    before: [],
    after: []
  }.freeze
end