Class: ConsulLoader::Loader
- Inherits:
-
Object
- Object
- ConsulLoader::Loader
- Defined in:
- lib/consul_loader/loader.rb
Instance Attribute Summary collapse
-
#parser ⇒ Object
Returns the value of attribute parser.
Instance Method Summary collapse
-
#initialize(parser) ⇒ Loader
constructor
A new instance of Loader.
- #load_config(location, server) ⇒ Object
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
#parser ⇒ Object
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 |