class NicoQuery::ObjectMapper::MylistRSS::Meta
Public Class Methods
new(parsed_xml, title_prefix)
click to toggle source
# File lib/nicoquery/object_mapper/mylist_rss.rb, line 32 def initialize(parsed_xml, title_prefix) @title_prefix = title_prefix @hash = parsed_xml end
Public Instance Methods
creator()
click to toggle source
# File lib/nicoquery/object_mapper/mylist_rss.rb, line 71 def creator return nil unless @hash['dc:creator'].present? @hash['dc:creator'] end
description()
click to toggle source
# File lib/nicoquery/object_mapper/mylist_rss.rb, line 55 def description return nil unless @hash['description'].present? return nil if @hash['description'] == "このマイリストは非公開に設定されています。" @hash['description'] end
last_build_date()
click to toggle source
# File lib/nicoquery/object_mapper/mylist_rss.rb, line 66 def last_build_date return nil unless @hash['lastBuildDate'].present? Time.parse @hash['lastBuildDate'] end
link()
click to toggle source
# File lib/nicoquery/object_mapper/mylist_rss.rb, line 46 def link @hash['link'].presence end
mylist_id()
click to toggle source
# File lib/nicoquery/object_mapper/mylist_rss.rb, line 50 def mylist_id return nil unless @hash['link'].present? @hash['link'].scan(/(?<=mylist\/)\d{1,}/)[0].to_i end
publish_date()
click to toggle source
# File lib/nicoquery/object_mapper/mylist_rss.rb, line 61 def publish_date return nil unless @hash['publish_date'].present? Time.parse @hash['publish_date'] end
title()
click to toggle source
# 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()
click to toggle source
# File lib/nicoquery/object_mapper/mylist_rss.rb, line 42 def url link end