Class: Unfig::FileLoader

Inherits:
Object
  • Object
show all
Defined in:
lib/unfig/file_loader.rb

Instance Method Summary collapse

Constructor Details

#initialize(params:, path:) ⇒ FileLoader

Returns a new instance of FileLoader.



3
4
5
6
# File 'lib/unfig/file_loader.rb', line 3

def initialize(params:, path:)
  @params = params
  @path = path
end

Instance Method Details

#readObject



8
9
10
11
12
13
14
15
16
17
# File 'lib/unfig/file_loader.rb', line 8

def read
  return @_read if defined?(@_read)

  @_read = {}
  params.params.each do |p|
    next unless p.enabled.include?("file")
    @_read[p.name] = read_for(p) if data.key?(p.name)
  end
  @_read
end