Class: PRWithParams::ConfigParser
- Inherits:
-
Object
- Object
- PRWithParams::ConfigParser
- Defined in:
- lib/pr_with_params/config_parser.rb
Defined Under Namespace
Classes: ParserError
Constant Summary collapse
- VALID_CONFIG_KEYS =
Constants
%i[validators base_branch template title labels assignees].freeze
Instance Attribute Summary collapse
-
#config_file_path ⇒ Object
readonly
Attributes.
-
#filtered_config ⇒ Object
readonly
Attributes.
-
#parsed_config ⇒ Object
readonly
Attributes.
-
#scope ⇒ Object
readonly
Attributes.
Instance Method Summary collapse
-
#initialize(config_file_path:, scope: nil) ⇒ ConfigParser
constructor
A new instance of ConfigParser.
- #parse! ⇒ Object
Constructor Details
#initialize(config_file_path:, scope: nil) ⇒ ConfigParser
Returns a new instance of ConfigParser.
13 14 15 16 |
# File 'lib/pr_with_params/config_parser.rb', line 13 def initialize(config_file_path:, scope: nil) @config_file_path = config_file_path @scope = scope&.to_sym || :default end |
Instance Attribute Details
#config_file_path ⇒ Object (readonly)
Attributes
8 9 10 |
# File 'lib/pr_with_params/config_parser.rb', line 8 def config_file_path @config_file_path end |
#filtered_config ⇒ Object (readonly)
Attributes
8 9 10 |
# File 'lib/pr_with_params/config_parser.rb', line 8 def filtered_config @filtered_config end |
#parsed_config ⇒ Object (readonly)
Attributes
8 9 10 |
# File 'lib/pr_with_params/config_parser.rb', line 8 def parsed_config @parsed_config end |
#scope ⇒ Object (readonly)
Attributes
8 9 10 |
# File 'lib/pr_with_params/config_parser.rb', line 8 def scope @scope end |
Instance Method Details
#parse! ⇒ Object
18 19 20 21 |
# File 'lib/pr_with_params/config_parser.rb', line 18 def parse! validate_file_type! parse_yaml_config end |