Class: Gitomator::Task::Config::ReposConfig
- Inherits:
-
Object
- Object
- Gitomator::Task::Config::ReposConfig
- Defined in:
- lib/gitomator/task/config/repos_config.rb
Instance Attribute Summary collapse
-
#default_access_permission ⇒ Object
readonly
Returns the value of attribute default_access_permission.
-
#repo_properties ⇒ Object
readonly
Returns the value of attribute repo_properties.
-
#source_repo ⇒ Object
readonly
Returns the value of attribute source_repo.
Instance Method Summary collapse
-
#initialize(config_obj) ⇒ ReposConfig
constructor
A new instance of ReposConfig.
-
#permissions(repo) ⇒ Hash<String,Symbol>
Map name (user or team) to permission (:read/:write/:admin).
-
#repos ⇒ Enumerable<Strings>
The names of the repos.
Constructor Details
#initialize(config_obj) ⇒ ReposConfig
Returns a new instance of ReposConfig.
16 17 18 19 20 21 22 23 24 |
# File 'lib/gitomator/task/config/repos_config.rb', line 16 def initialize(config_obj) raise "Missing required key, repos" unless config_obj.has_key? 'repos' = (config_obj['default_access_permission'] || :read).to_sym @source_repo = config_obj['source_repo'] @repo_properties = config_obj['repo_properties'] || {} = (config_obj['repos']) end |
Instance Attribute Details
#default_access_permission ⇒ Object (readonly)
Returns the value of attribute default_access_permission.
9 10 11 |
# File 'lib/gitomator/task/config/repos_config.rb', line 9 def end |
#repo_properties ⇒ Object (readonly)
Returns the value of attribute repo_properties.
10 11 12 |
# File 'lib/gitomator/task/config/repos_config.rb', line 10 def repo_properties @repo_properties end |
#source_repo ⇒ Object (readonly)
Returns the value of attribute source_repo.
11 12 13 |
# File 'lib/gitomator/task/config/repos_config.rb', line 11 def source_repo @source_repo end |
Instance Method Details
#permissions(repo) ⇒ Hash<String,Symbol>
Returns Map name (user or team) to permission (:read/:write/:admin).
38 39 40 |
# File 'lib/gitomator/task/config/repos_config.rb', line 38 def (repo) [repo] end |
#repos ⇒ Enumerable<Strings>
Returns The names of the repos.
30 31 32 |
# File 'lib/gitomator/task/config/repos_config.rb', line 30 def repos .keys end |