Class: Identitee::Loader

Inherits:
Object
  • Object
show all
Defined in:
lib/identitee/loader.rb

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Loader

Returns a new instance of Loader.



3
4
5
# File 'lib/identitee/loader.rb', line 3

def initialize options={}
  @identify_root_directory = options.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_allObject



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

Returns:

  • (Boolean)


7
8
9
# File 'lib/identitee/loader.rb', line 7

def loadable? filename
  File.exists? full_path(filename)
end