Class: YouTubeG::Parser::FeedParser
- Inherits:
-
Object
- Object
- YouTubeG::Parser::FeedParser
- Defined in:
- lib/youtube_g/parser.rb
Overview
:nodoc:
Direct Known Subclasses
Instance Attribute Summary collapse
-
#url_based ⇒ Object
(also: #url_based?)
readonly
Returns the value of attribute url_based.
Instance Method Summary collapse
-
#initialize(arg) ⇒ FeedParser
constructor
Accept a URL or a string assumed to be XML.
- #parse ⇒ Object
Constructor Details
#initialize(arg) ⇒ FeedParser
Accept a URL or a string assumed to be XML.
10 11 12 13 |
# File 'lib/youtube_g/parser.rb', line 10 def initialize(arg) @url_based = assert_valid_url(arg) @content = arg end |
Instance Attribute Details
#url_based ⇒ Object (readonly) Also known as: url_based?
Returns the value of attribute url_based.
6 7 8 |
# File 'lib/youtube_g/parser.rb', line 6 def url_based @url_based end |
Instance Method Details
#parse ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/youtube_g/parser.rb', line 15 def parse if @url_based parse_content open(@content).read else parse_content @content end end |