Class: Codeowners::Configuration
- Inherits:
-
Object
- Object
- Codeowners::Configuration
- Defined in:
- lib/codeowners/configuration.rb
Overview
Stores configuration options for the Codeowners gem.
Defined Under Namespace
Classes: MissingConfigurationError
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(organization_name: nil) ⇒ Configuration
constructor
A new instance of Configuration.
-
#organization_name ⇒ String
The organization name for teams.
-
#organization_name=(value) ⇒ Object
Set the default organization name for teams.
Constructor Details
#initialize(organization_name: nil) ⇒ Configuration
Returns a new instance of Configuration.
25 26 27 |
# File 'lib/codeowners/configuration.rb', line 25 def initialize(organization_name: nil) self.organization_name = organization_name end |
Class Method Details
.instance ⇒ Object
15 16 17 |
# File 'lib/codeowners/configuration.rb', line 15 def self.instance @instance ||= new end |
.reset_singleton_instance! ⇒ Object
19 20 21 |
# File 'lib/codeowners/configuration.rb', line 19 def self.reset_singleton_instance! @instance = nil end |
Instance Method Details
#organization_name ⇒ String
The organization name for teams
32 33 34 35 36 |
# File 'lib/codeowners/configuration.rb', line 32 def organization_name raise MissingConfigurationError, 'Organization name is required' if @organization_name.nil? @organization_name.dup end |
#organization_name=(value) ⇒ Object
Set the default organization name for teams
41 42 43 44 45 |
# File 'lib/codeowners/configuration.rb', line 41 def organization_name=(value) value = value.to_s.dup value.prepend(AT_PREFIX) unless value.start_with?(AT_PREFIX) @organization_name = value end |