module FunWith::Patterns::Loader::LoadingStyles::InstanceExec
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.
Public Instance Methods
loader_pattern_load_item( file )
click to toggle source
# 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