Class: LeeroyJenkins::JenkinsClientBuilder
- Inherits:
-
Object
- Object
- LeeroyJenkins::JenkinsClientBuilder
- Defined in:
- lib/leeroy_jenkins/jenkins_client_builder.rb
Overview
TODO: this isn’t what a builder is
Instance Attribute Summary collapse
-
#log_level ⇒ Object
readonly
Returns the value of attribute log_level.
-
#log_location ⇒ Object
readonly
Returns the value of attribute log_location.
-
#password ⇒ Object
readonly
Returns the value of attribute password.
-
#server_url ⇒ Object
readonly
Returns the value of attribute server_url.
-
#username ⇒ Object
readonly
Returns the value of attribute username.
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(options = {}) ⇒ JenkinsClientBuilder
constructor
A new instance of JenkinsClientBuilder.
Constructor Details
#initialize(options = {}) ⇒ JenkinsClientBuilder
Returns a new instance of JenkinsClientBuilder.
6 7 8 9 10 11 12 13 |
# File 'lib/leeroy_jenkins/jenkins_client_builder.rb', line 6 def initialize( = {}) @server_url = [:server_url] || ENV['LEEROY_JENKINS_SERVER_URL'] @username = [:username] || ENV['LEEROY_JENKINS_USERNAME'] @password = [:password] || ENV['LEEROY_JENKINS_PASSWORD'] @log_level = [:log_level] || 1 @log_location = [:log_location] || STDOUT end |
Instance Attribute Details
#log_level ⇒ Object (readonly)
Returns the value of attribute log_level.
4 5 6 |
# File 'lib/leeroy_jenkins/jenkins_client_builder.rb', line 4 def log_level @log_level end |
#log_location ⇒ Object (readonly)
Returns the value of attribute log_location.
4 5 6 |
# File 'lib/leeroy_jenkins/jenkins_client_builder.rb', line 4 def log_location @log_location end |
#password ⇒ Object (readonly)
Returns the value of attribute password.
4 5 6 |
# File 'lib/leeroy_jenkins/jenkins_client_builder.rb', line 4 def password @password end |
#server_url ⇒ Object (readonly)
Returns the value of attribute server_url.
4 5 6 |
# File 'lib/leeroy_jenkins/jenkins_client_builder.rb', line 4 def server_url @server_url end |
#username ⇒ Object (readonly)
Returns the value of attribute username.
4 5 6 |
# File 'lib/leeroy_jenkins/jenkins_client_builder.rb', line 4 def username @username end |
Instance Method Details
#build ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/leeroy_jenkins/jenkins_client_builder.rb', line 15 def build JenkinsApi::Client.new server_url: server_url, username: username, password: password, log_level: log_level, log_location: log_location end |