Class: RepoProviders
- Inherits:
-
Object
- Object
- RepoProviders
- Defined in:
- lib/git-issues/providers.rb
Instance Attribute Summary collapse
-
#providers ⇒ Object
readonly
Returns the value of attribute providers.
Instance Method Summary collapse
-
#initialize ⇒ RepoProviders
constructor
A new instance of RepoProviders.
- #map_urls_to_provider(urls) ⇒ Object
Constructor Details
#initialize ⇒ RepoProviders
Returns a new instance of RepoProviders.
25 26 27 28 29 |
# File 'lib/git-issues/providers.rb', line 25 def initialize @providers = RepoProvider.subclasses.map do |c| add_methods_to_provider(c) end end |
Instance Attribute Details
#providers ⇒ Object (readonly)
Returns the value of attribute providers.
24 25 26 |
# File 'lib/git-issues/providers.rb', line 24 def providers @providers end |
Instance Method Details
#map_urls_to_provider(urls) ⇒ Object
31 32 33 34 35 36 37 38 |
# File 'lib/git-issues/providers.rb', line 31 def map_urls_to_provider urls urls.map do |url| # get the first valid provider (or nil otherwise) @providers.map do |p| create_provider(p,url) end.compact.first end.compact end |