Class: BuPr::Configuration
- Inherits:
-
Object
- Object
- BuPr::Configuration
- Includes:
- Singleton
- Defined in:
- lib/bu_pr/configuration.rb
Instance Attribute Summary collapse
-
#branch ⇒ Object
(also: #base_branch)
Returns the value of attribute branch.
-
#title ⇒ Object
(also: #pr_title)
Returns the value of attribute title.
-
#token ⇒ Object
(also: #access_token)
Returns the value of attribute token.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #valid? ⇒ Boolean
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
25 26 27 28 29 30 31 |
# File 'lib/bu_pr/configuration.rb', line 25 def initialize @branch = ENV.fetch("BUPR_BRANCH") { "master" } @title = ENV.fetch("BUPR_TITLE") { "Bundle update #{Time.now.strftime('%F')}" } @token = ENV["BUPR_TOKEN"] @repo = ENV["BUPR_REPO"] end |
Instance Attribute Details
#branch ⇒ Object Also known as: base_branch
Returns the value of attribute branch.
8 9 10 |
# File 'lib/bu_pr/configuration.rb', line 8 def branch @branch end |
#title ⇒ Object Also known as: pr_title
Returns the value of attribute title.
8 9 10 |
# File 'lib/bu_pr/configuration.rb', line 8 def title @title end |
#token ⇒ Object Also known as: access_token
Returns the value of attribute token.
8 9 10 |
# File 'lib/bu_pr/configuration.rb', line 8 def token @token end |
Instance Method Details
#valid? ⇒ Boolean
33 34 35 |
# File 'lib/bu_pr/configuration.rb', line 33 def valid? token? && branch? && title? && repo? end |