Class: Scrapers::RubyTapas::Episode
- Inherits:
-
Object
- Object
- Scrapers::RubyTapas::Episode
- Defined in:
- lib/scrapers/rubytapas/episode.rb
Defined Under Namespace
Classes: FileLink
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
-
#file_list ⇒ Object
Returns the value of attribute file_list.
-
#guid ⇒ Object
Returns the value of attribute guid.
-
#link ⇒ Object
Returns the value of attribute link.
-
#number ⇒ Object
Returns the value of attribute number.
-
#pub_date ⇒ Object
Returns the value of attribute pub_date.
-
#slug ⇒ Object
Returns the value of attribute slug.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
- #file_list_from_description ⇒ Object
-
#initialize(*args) ⇒ Episode
constructor
A new instance of Episode.
- #number_from_title ⇒ Object
- #slug_from_title ⇒ Object
Constructor Details
#initialize(*args) ⇒ Episode
Returns a new instance of Episode.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/scrapers/rubytapas/episode.rb', line 14 def initialize(*args) if args.size == 1 case args[0] when String parse_item(Nokogiri::XML.parse(args[0]){|c| c.noblanks}.children.first) when Nokogiri::XML::Element parse_item(args[0]) when Hash (args[0]) else end elsif args.size > 1 assign_from_args(*args) end end |
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
12 13 14 |
# File 'lib/scrapers/rubytapas/episode.rb', line 12 def description @description end |
#file_list ⇒ Object
Returns the value of attribute file_list.
12 13 14 |
# File 'lib/scrapers/rubytapas/episode.rb', line 12 def file_list @file_list end |
#guid ⇒ Object
Returns the value of attribute guid.
12 13 14 |
# File 'lib/scrapers/rubytapas/episode.rb', line 12 def guid @guid end |
#link ⇒ Object
Returns the value of attribute link.
12 13 14 |
# File 'lib/scrapers/rubytapas/episode.rb', line 12 def link @link end |
#number ⇒ Object
Returns the value of attribute number.
12 13 14 |
# File 'lib/scrapers/rubytapas/episode.rb', line 12 def number @number end |
#pub_date ⇒ Object
Returns the value of attribute pub_date.
12 13 14 |
# File 'lib/scrapers/rubytapas/episode.rb', line 12 def pub_date @pub_date end |
#slug ⇒ Object
Returns the value of attribute slug.
12 13 14 |
# File 'lib/scrapers/rubytapas/episode.rb', line 12 def slug @slug end |
#title ⇒ Object
Returns the value of attribute title.
12 13 14 |
# File 'lib/scrapers/rubytapas/episode.rb', line 12 def title @title end |
Instance Method Details
#file_list_from_description ⇒ Object
38 39 40 |
# File 'lib/scrapers/rubytapas/episode.rb', line 38 def file_list_from_description find_file_list(description) end |
#number_from_title ⇒ Object
30 31 32 |
# File 'lib/scrapers/rubytapas/episode.rb', line 30 def number_from_title title.scan(/\w+/).first end |
#slug_from_title ⇒ Object
34 35 36 |
# File 'lib/scrapers/rubytapas/episode.rb', line 34 def slug_from_title title.to_s.to_url end |