Class: SortedSearch::Provider
- Inherits:
-
Object
- Object
- SortedSearch::Provider
- Defined in:
- lib/sorted_search/providers/provider.rb
Overview
base class for printers
Direct Known Subclasses
Instance Attribute Summary collapse
-
#sorting_criteria ⇒ Object
readonly
Returns the value of attribute sorting_criteria.
Instance Method Summary collapse
-
#fetch_data ⇒ Object
private.
-
#initialize(specs, sorting_criteria) ⇒ Provider
constructor
A new instance of Provider.
- #pod_from_spec(spec) ⇒ Object
- #provide_sorted_specs ⇒ Object
- #sort_specs ⇒ Object
Constructor Details
#initialize(specs, sorting_criteria) ⇒ Provider
Returns a new instance of Provider.
11 12 13 14 |
# File 'lib/sorted_search/providers/provider.rb', line 11 def initialize(specs, sorting_criteria) @specs = specs @sorting_criteria = sorting_criteria end |
Instance Attribute Details
#sorting_criteria ⇒ Object (readonly)
Returns the value of attribute sorting_criteria.
9 10 11 |
# File 'lib/sorted_search/providers/provider.rb', line 9 def sorting_criteria @sorting_criteria end |
Instance Method Details
#fetch_data ⇒ Object
private
23 24 25 26 27 28 |
# File 'lib/sorted_search/providers/provider.rb', line 23 def fetch_data found = "\nFound " + @specs.count.to_s + " specs. Fetching GitHub info, wait a moment please.\n" Pod::UI.puts found.green @progress_bar = ProgressBar.create(total: @specs.count, length: 60) end |
#pod_from_spec(spec) ⇒ Object
33 34 35 |
# File 'lib/sorted_search/providers/provider.rb', line 33 def pod_from_spec(spec) Pod::Specification::Set::Presenter.new(spec) end |
#provide_sorted_specs ⇒ Object
16 17 18 19 |
# File 'lib/sorted_search/providers/provider.rb', line 16 def provide_sorted_specs fetch_data sort_specs end |
#sort_specs ⇒ Object
30 31 |
# File 'lib/sorted_search/providers/provider.rb', line 30 def sort_specs end |