Class: YoutubePop::StandardApi
- Inherits:
-
Object
- Object
- YoutubePop::StandardApi
- Defined in:
- lib/youtube_pop/standard_api.rb
Instance Method Summary collapse
-
#initialize ⇒ StandardApi
constructor
A new instance of StandardApi.
- #most_discussed ⇒ Object
- #most_popular ⇒ Object
- #most_recent ⇒ Object
- #most_responded ⇒ Object
- #most_shared ⇒ Object
- #most_viewed ⇒ Object
- #recently_featured ⇒ Object
- #top_favorites ⇒ Object
- #top_rated ⇒ Object
- #trending_videos ⇒ Object
Constructor Details
#initialize ⇒ StandardApi
Returns a new instance of StandardApi.
18 19 20 21 22 23 24 25 26 27 |
# File 'lib/youtube_pop/standard_api.rb', line 18 def initialize = { :timeout => 2, :open_timeout => 2 } @conn = Faraday.new(:url => 'https://gdata.youtube.com', :options => ) do |builder| builder.request :url_encoded builder.adapter :net_http end end |
Instance Method Details
#most_discussed ⇒ Object
59 60 61 62 |
# File 'lib/youtube_pop/standard_api.rb', line 59 def most_discussed response = response_from url_for("most_discussed") get_entries(response) end |
#most_popular ⇒ Object
49 50 51 52 |
# File 'lib/youtube_pop/standard_api.rb', line 49 def most_popular response = response_from url_for("most_popular") get_entries(response) end |
#most_recent ⇒ Object
54 55 56 57 |
# File 'lib/youtube_pop/standard_api.rb', line 54 def most_recent response = response_from url_for("most_recent") get_entries(response) end |
#most_responded ⇒ Object
64 65 66 67 |
# File 'lib/youtube_pop/standard_api.rb', line 64 def most_responded response = response_from url_for("most_responded") get_entries(response) end |
#most_shared ⇒ Object
39 40 41 42 |
# File 'lib/youtube_pop/standard_api.rb', line 39 def most_shared response = response_from url_for("most_shared") get_entries(response) end |
#most_viewed ⇒ Object
44 45 46 47 |
# File 'lib/youtube_pop/standard_api.rb', line 44 def most_viewed response = response_from url_for("most_viewed") get_entries(response) end |
#recently_featured ⇒ Object
69 70 71 72 |
# File 'lib/youtube_pop/standard_api.rb', line 69 def recently_featured response = response_from url_for("recently_featured") get_entries(response) end |
#top_favorites ⇒ Object
34 35 36 37 |
# File 'lib/youtube_pop/standard_api.rb', line 34 def top_favorites response = response_from url_for("top_favorites") get_entries(response) end |
#top_rated ⇒ Object
29 30 31 32 |
# File 'lib/youtube_pop/standard_api.rb', line 29 def top_rated response = response_from url_for("top_rated") get_entries(response) end |
#trending_videos ⇒ Object
74 75 76 77 |
# File 'lib/youtube_pop/standard_api.rb', line 74 def trending_videos response = response_from url_for("on_the_web") get_entries(response) end |