Module: PreAndPostInitialize::ObjectInstance

Defined in:
lib/pre_and_post_initialize/object_instance.rb

Overview

Adds #pre_initialize and #post_initialize before and after call to #initialize.

Instance Method Summary collapse

Instance Method Details

#post_initialize(any_arg, ...) ⇒ Object

Permits activity to be defined after all initialization activity.



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

def post_initialize( *args, & block )
  # nothing here - subclasses define
end

#pre_initialize(any_arg, ...) ⇒ Object

Permits activity to be defined prior to any initialization activity. This can be useful

if initialization activity may depend on a particular feature, such as instance registration,
prior to activity occuring that queries or otherwise implicates its identity/definition.


24
25
26
# File 'lib/pre_and_post_initialize/object_instance.rb', line 24

def pre_initialize( *args, & block )
  # nothing here - subclasses define
end