Class: Dployr::Init
- Inherits:
-
Object
- Object
- Dployr::Init
- Includes:
- Config::FileUtils
- Defined in:
- lib/dployr/init.rb
Constant Summary collapse
- @@instance =
nil
Constants included from Config::Constants
Config::Constants::EXTENSIONS, Config::Constants::FILENAME, Config::Constants::FILENAMES
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#file_path ⇒ Object
Returns the value of attribute file_path.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Init
constructor
A new instance of Init.
- #load_config(file_path = nil) ⇒ Object
Methods included from Config::FileUtils
discover, read_yaml, yaml_file?
Constructor Details
#initialize(attributes = {}) ⇒ Init
Returns a new instance of Init.
35 36 37 38 39 |
# File 'lib/dployr/init.rb', line 35 def initialize(attributes = {}) @@instance = self @config = Dployr::Configuration.new attributes @file_path = nil end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
30 31 32 |
# File 'lib/dployr/init.rb', line 30 def config @config end |
#file_path ⇒ Object
Returns the value of attribute file_path.
31 32 33 |
# File 'lib/dployr/init.rb', line 31 def file_path @file_path end |
Class Method Details
.instance ⇒ Object
41 42 43 |
# File 'lib/dployr/init.rb', line 41 def self.instance @@instance end |
Instance Method Details
#load_config(file_path = nil) ⇒ Object
45 46 47 48 49 50 51 52 53 |
# File 'lib/dployr/init.rb', line 45 def load_config(file_path = nil) @file_path = if file_path file_path else discover end set_config @file_path end |