Class: Identitee::Loader
- Inherits:
-
Object
- Object
- Identitee::Loader
- Defined in:
- lib/identitee/loader.rb
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Loader
constructor
A new instance of Loader.
- #lazy_load(filename) ⇒ Object
- #load_all ⇒ Object
- #loadable?(filename) ⇒ Boolean
Constructor Details
#initialize(options = {}) ⇒ Loader
Returns a new instance of Loader.
3 4 5 |
# File 'lib/identitee/loader.rb', line 3 def initialize ={} @identify_root_directory = .delete(:identify_root_directory) end |
Instance Method Details
#lazy_load(filename) ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/identitee/loader.rb', line 11 def lazy_load filename if loadable? filename force_load full_path(filename) else yield if block_given? end end |
#load_all ⇒ Object
19 20 21 22 23 |
# File 'lib/identitee/loader.rb', line 19 def load_all if not_fully_loaded? force_full_load end end |
#loadable?(filename) ⇒ Boolean
7 8 9 |
# File 'lib/identitee/loader.rb', line 7 def loadable? filename File.exists? full_path(filename) end |