Class: Turbo::PathConfigurationLoader

Inherits:
Object
  • Object
show all
Defined in:
lib/turbo/path_configuration/path_configuration_loader.rb

Constant Summary collapse

PathConfigurationLoaderCompletionHandler =
Class.new(PathConfigurationDecoder)

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#completionHandlerObject

Returns the value of attribute completionHandler.



5
6
7
# File 'lib/turbo/path_configuration/path_configuration_loader.rb', line 5

def completionHandler
  @completionHandler
end

#sourcesObject

Returns the value of attribute sources.



5
6
7
# File 'lib/turbo/path_configuration/path_configuration_loader.rb', line 5

def sources
  @sources
end

Instance Method Details

#initWithSources(sources) ⇒ Object



6
7
8
9
# File 'lib/turbo/path_configuration/path_configuration_loader.rb', line 6

def initWithSources(sources)
  self.sources = sources
  self
end

#load(&completionHandler) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/turbo/path_configuration/path_configuration_loader.rb', line 11

def load(&completionHandler)
  #completionHandler = PathConfigurationLoaderCompletionHandler.new

  sources.each do |source|
    #case source
    #when .data(let data)
      #data = loadData(source)
      data = loadFile(source)
      completionHandler.call(data)

    #when .file(let url):
      #loadFile(source)
    #when .server(let url):
      #download(from: url)
    #end
  end
end