Class: Gb::GbConfig
- Inherits:
-
Object
- Object
- Gb::GbConfig
- Defined in:
- lib/config/gb_config.rb
Defined Under Namespace
Classes: GitlabConfig, ProjectConfig
Instance Attribute Summary collapse
-
#config_path ⇒ Object
readonly
Returns the value of attribute config_path.
-
#gitlab ⇒ Object
readonly
Returns the value of attribute gitlab.
-
#projects ⇒ Object
readonly
Returns the value of attribute projects.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(config_path, node) ⇒ GbConfig
constructor
A new instance of GbConfig.
- #to_dictionary ⇒ Object
Constructor Details
#initialize(config_path, node) ⇒ GbConfig
Returns a new instance of GbConfig.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/config/gb_config.rb', line 8 def initialize(config_path, node) @config_path = config_path gitlab = node['gitlab'] @gitlab = GitlabConfig.new(gitlab) @projects = [] projects = node['projects'] if !projects.nil? projects.each do |project| projectConfig = ProjectConfig.new(project) @projects << projectConfig end end end |
Instance Attribute Details
#config_path ⇒ Object (readonly)
Returns the value of attribute config_path.
6 7 8 |
# File 'lib/config/gb_config.rb', line 6 def config_path @config_path end |
#gitlab ⇒ Object (readonly)
Returns the value of attribute gitlab.
5 6 7 |
# File 'lib/config/gb_config.rb', line 5 def gitlab @gitlab end |
#projects ⇒ Object (readonly)
Returns the value of attribute projects.
4 5 6 |
# File 'lib/config/gb_config.rb', line 4 def projects @projects end |
Class Method Details
Instance Method Details
#to_dictionary ⇒ Object
34 35 36 37 38 39 |
# File 'lib/config/gb_config.rb', line 34 def to_dictionary projects = self.projects.map do |project| project.to_dictionary end {"projects"=>projects, "gitlab"=>self.gitlab.to_dictionary} end |