Class: YoutubeFeed::Parser
- Inherits:
-
Object
- Object
- YoutubeFeed::Parser
- Defined in:
- lib/youtube_feed/parser.rb
Instance Attribute Summary collapse
-
#youtube_feed_url ⇒ Object
Returns the value of attribute youtube_feed_url.
Instance Method Summary collapse
- #fetch_and_parse ⇒ Object
-
#initialize(youtube_feed_url) ⇒ Parser
constructor
A new instance of Parser.
Constructor Details
#initialize(youtube_feed_url) ⇒ Parser
Returns a new instance of Parser.
13 14 15 |
# File 'lib/youtube_feed/parser.rb', line 13 def initialize(youtube_feed_url) @youtube_feed_url = youtube_feed_url end |
Instance Attribute Details
#youtube_feed_url ⇒ Object
Returns the value of attribute youtube_feed_url.
11 12 13 |
# File 'lib/youtube_feed/parser.rb', line 11 def youtube_feed_url @youtube_feed_url end |
Instance Method Details
#fetch_and_parse ⇒ Object
17 18 19 20 |
# File 'lib/youtube_feed/parser.rb', line 17 def fetch_and_parse response = Faraday.new(@youtube_feed_url).get YoutubeFeed::Atom.parse(response.body) end |