Module: FunWith::Configurations::LoadingStyle
- Defined in:
- lib/fun_with/configurations/loader_style.rb
Instance Method Summary collapse
-
#loader_pattern_load_item(file) ⇒ Object
Default behavior: read the file, evaluate it, expect a ruby object of the class that the loader pattern is installed on.
Instance Method Details
#loader_pattern_load_item(file) ⇒ Object
Default behavior: read the file, evaluate it, expect a ruby object of the class that the loader pattern is installed on. If anything goes wrong (file no exist, syntax error), returns a nil.
Override in your class if you need your files translated into objects differently.
12 13 14 15 16 17 18 |
# File 'lib/fun_with/configurations/loader_style.rb', line 12 def loader_pattern_load_item( file ) self.loader_pattern_rescue_failing_item_load( file ) do obj = Config.from_file( file ) return obj end end |