class Zootool::ItemsQuery
Performs Zootool
item queries to the Zootool
API. This includes queries for popular items.
Usage: You don't need to create an object of this class directly. Instead use the item method on your ZootoolApi
object.
See zootool.com/api/docs/items for Items API documentation.
Public Instance Methods
info(uid)
click to toggle source
Returns the info for an item with the specified uid.
Returns a hash containing the item info.
# File lib/zootool/items_query.rb, line 19 def info(uid) hash = {:uid => uid} @api.request("items/info/?#{build_query_string(hash)}") end
popular(type='all')
click to toggle source
Returns the most popular items. The time period for which to return popular items may be specified via the type parameter. Valid values are: all, month, week, today. If not specified (or if an invalid time period is specified), it will default to all.
Returns an array of hashes containing item info.
# File lib/zootool/items_query.rb, line 31 def popular(type='all') # ensure only allowed popular types type = 'all' unless ['all','month','week','today'].include?(type) @api.request("items/popular/?type=#{type}") end