module FunWith::Patterns::Loader::LoadingStyles::YAML
Public Instance Methods
loader_pattern_load_item( file )
click to toggle source
# File lib/fun_with/patterns/loader/loading_styles/yaml.rb, line 6 def loader_pattern_load_item( file ) self.loader_pattern_rescue_failing_item_load( file ) do obj = self.new hash = Psych.load( file.read ) for method, val in hash eq_method = :"#{method}=" if obj.respond_to?( eq_method ) obj.send( eq_method, val ) end end return obj end end