Class: PairingMatrix::RemoteRepos
- Inherits:
-
Object
- Object
- PairingMatrix::RemoteRepos
- Defined in:
- lib/pairing_matrix/config/remote_repos.rb
Instance Attribute Summary collapse
-
#access_token ⇒ Object
readonly
Returns the value of attribute access_token.
-
#authors_regex ⇒ Object
readonly
Returns the value of attribute authors_regex.
-
#repositories ⇒ Object
readonly
Returns the value of attribute repositories.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Class Method Summary collapse
Instance Method Summary collapse
- #absent? ⇒ Boolean
- #has_access_token? ⇒ Boolean
-
#initialize(authors_regex, repos, access_token, url) ⇒ RemoteRepos
constructor
A new instance of RemoteRepos.
Constructor Details
#initialize(authors_regex, repos, access_token, url) ⇒ RemoteRepos
Returns a new instance of RemoteRepos.
5 6 7 8 9 10 |
# File 'lib/pairing_matrix/config/remote_repos.rb', line 5 def initialize(, repos, access_token, url) @url = url @repositories = repos = @access_token = access_token end |
Instance Attribute Details
#access_token ⇒ Object (readonly)
Returns the value of attribute access_token.
3 4 5 |
# File 'lib/pairing_matrix/config/remote_repos.rb', line 3 def access_token @access_token end |
#authors_regex ⇒ Object (readonly)
Returns the value of attribute authors_regex.
3 4 5 |
# File 'lib/pairing_matrix/config/remote_repos.rb', line 3 def end |
#repositories ⇒ Object (readonly)
Returns the value of attribute repositories.
3 4 5 |
# File 'lib/pairing_matrix/config/remote_repos.rb', line 3 def repositories @repositories end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
3 4 5 |
# File 'lib/pairing_matrix/config/remote_repos.rb', line 3 def url @url end |
Class Method Details
.create_from(authors_regex, config) ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/pairing_matrix/config/remote_repos.rb', line 12 def self.create_from(, config) repos = config['repositories'] rescue [] access_token = config['access_token'] rescue nil url = config['url'] rescue nil RemoteRepos.new(, repos, access_token, url) end |
Instance Method Details
#absent? ⇒ Boolean
24 25 26 |
# File 'lib/pairing_matrix/config/remote_repos.rb', line 24 def absent? @repositories.empty? end |
#has_access_token? ⇒ Boolean
20 21 22 |
# File 'lib/pairing_matrix/config/remote_repos.rb', line 20 def has_access_token? !@access_token.nil? && !@access_token.empty? end |