Class: DeployCouch::Config
- Inherits:
-
Object
- Object
- DeployCouch::Config
- Defined in:
- lib/deploy_couch/config.rb
Class Method Summary collapse
Instance Method Summary collapse
- #database ⇒ Object
- #delta_path ⇒ Object
- #doc_type_field ⇒ Object
- #hostname ⇒ Object
-
#initialize(config) ⇒ Config
constructor
A new instance of Config.
- #merge_config(config) ⇒ Object
- #port ⇒ Object
- #type_version_field ⇒ Object
Constructor Details
#initialize(config) ⇒ Config
Returns a new instance of Config.
5 6 7 |
# File 'lib/deploy_couch/config.rb', line 5 def initialize(config) @config = config end |
Class Method Details
.create_from_file(config_file) ⇒ Object
9 10 11 12 13 |
# File 'lib/deploy_couch/config.rb', line 9 def self.create_from_file(config_file) config = YAML.load_file(config_file) config = config.merge("config_folder_path" => File.dirname(config_file)) Config.new(config) end |
Instance Method Details
#database ⇒ Object
27 28 29 |
# File 'lib/deploy_couch/config.rb', line 27 def database @config["database"] end |
#delta_path ⇒ Object
23 24 25 |
# File 'lib/deploy_couch/config.rb', line 23 def delta_path @config["config_folder_path"] + "/" + @config["delta_path"] end |
#doc_type_field ⇒ Object
31 32 33 |
# File 'lib/deploy_couch/config.rb', line 31 def doc_type_field @config["doc_type_field"] end |
#hostname ⇒ Object
15 16 17 |
# File 'lib/deploy_couch/config.rb', line 15 def hostname @config["hostname"] end |
#merge_config(config) ⇒ Object
39 40 41 |
# File 'lib/deploy_couch/config.rb', line 39 def merge_config(config) @config = @config.merge(config) end |
#port ⇒ Object
19 20 21 |
# File 'lib/deploy_couch/config.rb', line 19 def port @config["port"] end |
#type_version_field ⇒ Object
35 36 37 |
# File 'lib/deploy_couch/config.rb', line 35 def type_version_field @config["type_version_field"] end |