Module: FunWith::Patterns::Loader::LoadingStyles::InstanceExec

Defined in:
lib/fun_with/patterns/loader/loading_styles/instance_exec.rb

Overview

Assumes the class does not take arguments in its initialize() method. The contents of the file are run via instance_exec to configure the object.

Instance Method Summary collapse

Instance Method Details

#loader_pattern_load_item(file) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/fun_with/patterns/loader/loading_styles/instance_exec.rb', line 8

def loader_pattern_load_item( file )
  self.loader_pattern_rescue_failing_item_load( file ) do
    obj = self.new
    
    # obj.instance_eval( file.read )
    obj.instance_exec do
      eval( file.read )
    end
                  
    return obj
  end
end