Class: BuPr::Configuration

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/bu_pr/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

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

#branchObject 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

#titleObject 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

#tokenObject 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

Returns:

  • (Boolean)


33
34
35
# File 'lib/bu_pr/configuration.rb', line 33

def valid?
  token? && branch? && title? && repo?
end