Class: Dependabot::PullRequestCreator::CommitMessageOptions
- Inherits:
-
Object
- Object
- Dependabot::PullRequestCreator::CommitMessageOptions
- Extended by:
- T::Sig
- Defined in:
- lib/dependabot/pull_request_creator/commit_message_options.rb
Overview
Typed view over the commit_message_options hash threaded into the PR
creator's title and prefix builders. The raw options arrive as a loosely
typed hash sourced from user config, so this parses the known keys once at
the boundary and lets downstream builders use typed readers instead of
digging an untyped hash.
Instance Attribute Summary collapse
-
#include_scope ⇒ Object
readonly
Returns the value of attribute include_scope.
-
#prefix ⇒ Object
readonly
Returns the value of attribute prefix.
-
#prefix_development ⇒ Object
readonly
Returns the value of attribute prefix_development.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(prefix: nil, prefix_development: nil, include_scope: false) ⇒ CommitMessageOptions
constructor
A new instance of CommitMessageOptions.
- #prefix? ⇒ Boolean
- #prefix_development? ⇒ Boolean
Constructor Details
#initialize(prefix: nil, prefix_development: nil, include_scope: false) ⇒ CommitMessageOptions
Returns a new instance of CommitMessageOptions.
32 33 34 35 36 |
# File 'lib/dependabot/pull_request_creator/commit_message_options.rb', line 32 def initialize(prefix: nil, prefix_development: nil, include_scope: false) @prefix = prefix @prefix_development = prefix_development @include_scope = include_scope end |
Instance Attribute Details
#include_scope ⇒ Object (readonly)
Returns the value of attribute include_scope.
23 24 25 |
# File 'lib/dependabot/pull_request_creator/commit_message_options.rb', line 23 def include_scope @include_scope end |
#prefix ⇒ Object (readonly)
Returns the value of attribute prefix.
17 18 19 |
# File 'lib/dependabot/pull_request_creator/commit_message_options.rb', line 17 def prefix @prefix end |
#prefix_development ⇒ Object (readonly)
Returns the value of attribute prefix_development.
20 21 22 |
# File 'lib/dependabot/pull_request_creator/commit_message_options.rb', line 20 def prefix_development @prefix_development end |
Class Method Details
.from_hash(options) ⇒ Object
41 42 43 44 45 46 47 |
# File 'lib/dependabot/pull_request_creator/commit_message_options.rb', line 41 def self.from_hash() new( prefix: coerce_string([:prefix]), prefix_development: coerce_string([:prefix_development]), include_scope: [:include_scope] ? true : false ) end |
Instance Method Details
#prefix? ⇒ Boolean
59 60 61 |
# File 'lib/dependabot/pull_request_creator/commit_message_options.rb', line 59 def prefix? !prefix.nil? end |
#prefix_development? ⇒ Boolean
65 66 67 |
# File 'lib/dependabot/pull_request_creator/commit_message_options.rb', line 65 def prefix_development? !prefix_development.nil? end |