Class: ConsulLoader::Loader

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(parser) ⇒ Loader

Returns a new instance of Loader.



6
7
8
# File 'lib/consul_loader/loader.rb', line 6

def initialize parser
  self.parser = parser
end

Instance Attribute Details

#parserObject

Returns the value of attribute parser.



4
5
6
# File 'lib/consul_loader/loader.rb', line 4

def parser
  @parser
end

Instance Method Details

#load_config(location, server) ⇒ Object



10
11
12
13
14
15
16
17
# File 'lib/consul_loader/loader.rb', line 10

def load_config location, server
  if File.directory? location
    load_folder location, server
  elsif load_file_and_upload location, server
  else
    raise Errno::ENOENT
  end
end