Class: BuPr::Configuration
- Inherits:
-
Object
- Object
- BuPr::Configuration
- Defined in:
- lib/bu_pr/configuration.rb
Constant Summary collapse
- ATTRS =
%i( branch title token repo )
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ Configuration
constructor
A new instance of Configuration.
- #valid? ⇒ Boolean
Constructor Details
#initialize(opts = {}) ⇒ Configuration
Returns a new instance of Configuration.
19 20 21 22 23 24 25 |
# File 'lib/bu_pr/configuration.rb', line 19 def initialize opts = {} @branch = opts.fetch(:branch) { ENV.fetch("BUPR_BRANCH") { "master" } } @title = opts.fetch(:title) { ENV.fetch("BUPR_TITLE") { default_title } } @token = opts.fetch(:token) { ENV["BUPR_TOKEN"] } @repo = opts.fetch(:repo) { ENV["BUPR_REPO"] } end |
Instance Method Details
#valid? ⇒ Boolean
28 29 30 |
# File 'lib/bu_pr/configuration.rb', line 28 def valid? token? && branch? && title? && repo? end |