Class: NicoQuery::ObjectMapper::MylistRSS::Meta
- Inherits:
-
Object
- Object
- NicoQuery::ObjectMapper::MylistRSS::Meta
- Defined in:
- lib/nicoquery/object_mapper/mylist_rss.rb
Instance Method Summary collapse
- #creator ⇒ Object
- #description ⇒ Object
-
#initialize(parsed_xml, title_prefix) ⇒ Meta
constructor
A new instance of Meta.
- #last_build_date ⇒ Object
- #link ⇒ Object
- #mylist_id ⇒ Object
- #publish_date ⇒ Object
- #title ⇒ Object
- #url ⇒ Object
Constructor Details
#initialize(parsed_xml, title_prefix) ⇒ Meta
Returns a new instance of Meta.
32 33 34 35 |
# File 'lib/nicoquery/object_mapper/mylist_rss.rb', line 32 def initialize(parsed_xml, title_prefix) @title_prefix = title_prefix @hash = parsed_xml end |
Instance Method Details
#creator ⇒ Object
67 68 69 |
# File 'lib/nicoquery/object_mapper/mylist_rss.rb', line 67 def creator @hash['dc:creator'] end |
#description ⇒ Object
55 56 57 |
# File 'lib/nicoquery/object_mapper/mylist_rss.rb', line 55 def description @hash['description'] end |
#last_build_date ⇒ Object
63 64 65 |
# File 'lib/nicoquery/object_mapper/mylist_rss.rb', line 63 def last_build_date Time.parse @hash['lastBuildDate'] end |
#link ⇒ Object
47 48 49 |
# File 'lib/nicoquery/object_mapper/mylist_rss.rb', line 47 def link @hash['link'] end |
#mylist_id ⇒ Object
51 52 53 |
# File 'lib/nicoquery/object_mapper/mylist_rss.rb', line 51 def mylist_id @hash['link'].scan(/(?<=mylist\/)\d{1,}/)[0].to_i end |
#publish_date ⇒ Object
59 60 61 |
# File 'lib/nicoquery/object_mapper/mylist_rss.rb', line 59 def publish_date Time.parse @hash['publish_date'] end |
#title ⇒ Object
37 38 39 40 41 |
# File 'lib/nicoquery/object_mapper/mylist_rss.rb', line 37 def title @hash['title'] .scan(/(?<=#{@title_prefix}\s).+(?=\‐ニコニコ動画)/)[0].split(' ')[0] # .force_encoding('utf-8') end |
#url ⇒ Object
43 44 45 |
# File 'lib/nicoquery/object_mapper/mylist_rss.rb', line 43 def url link end |