lib/nicoquery/object_mapper/getthumbinfo.rb in nicoquery-0.1.6.1 vs lib/nicoquery/object_mapper/getthumbinfo.rb in nicoquery-0.1.7

- old
+ new

@@ -18,9 +18,25 @@ else false end end + def community? + if @parsed_xml['nicovideo_thumb_response']["error"].presence + @parsed_xml['nicovideo_thumb_response']["error"].presence["code"].presence == "COMMUNITY" + else + false + end + end + + def exist? + if @parsed_xml['nicovideo_thumb_response']["error"].presence + @parsed_xml['nicovideo_thumb_response']["error"].presence["code"].presence != "NOT_FOUND" + else + false + end + end + def video_id return nil if @hash == nil @hash['video_id'] end \ No newline at end of file