class NicoQuery::Parser::TagSearch::Item

Public Class Methods

new(object) click to toggle source
# File lib/nicoquery/parser/tag_search.rb, line 37
def initialize(object)
  @object = object
end

Public Instance Methods

description() click to toggle source
# File lib/nicoquery/parser/tag_search.rb, line 63
def description
  @_description ||= Description.new @object["description"]
end
length() click to toggle source
# File lib/nicoquery/parser/tag_search.rb, line 67
def length
  description.raw_text.scan(/(?<=class\=\"nico\-info\-length\"\>)\d{1,}\:\d{1,2}(?=\<\/strong\>)/)
  length_string = $&.to_s.split(':')
  length_string[0].to_i * 60 + length_string[1].to_i
end
publish_date() click to toggle source
# File lib/nicoquery/parser/tag_search.rb, line 54
def publish_date
  Time.parse @object["pubDate"]
end
thumbnail_url() click to toggle source
# File lib/nicoquery/parser/tag_search.rb, line 58
def thumbnail_url
  description.raw_text.scan(/(?<=src\=\").{1,}(?=\"\swidth)/)
  $&
end
title() click to toggle source
# File lib/nicoquery/parser/tag_search.rb, line 41
def title
  @object["title"]
end
url() click to toggle source
# File lib/nicoquery/parser/tag_search.rb, line 50
def url
  @object["link"]
end
video_id() click to toggle source
# File lib/nicoquery/parser/tag_search.rb, line 45
def video_id
  url.scan(/(sm|nm)\d{1,}\Z/)
  $&
end