lib/nicoquery/object_mapper/video_array.rb in nicoquery-0.1.8.6 vs lib/nicoquery/object_mapper/video_array.rb in nicoquery-0.1.8.7
- old
+ new
@@ -91,10 +91,13 @@
def community_id
@hash['thread']['community_id'].to_i
end
def tags
- @hash['tags']['tag_info'].each_with_object([]) do |tag, array|
+ tag_hash = @hash['tags']['tag_info'].instance_of? Array
+ tag_hash = [ @hash['tags']['tag_info'] ] unless tag_hash.instance_of? Array
+
+ tag_hash.each_with_object([]) do |tag, array|
array << { text: tag['tag'] }
end
end
end
end