Method: Howcast::Client#category

Defined in:
lib/howcast/client/category.rb

#category(id) ⇒ Object

Provides access to the Howcast category API.

Inputs

  • id – The id of the category to lookup

Outputs

Category object if the id exists or nil if the id doesn’t exist or is malformed

Exceptions

  • Howcast::ApiNotFound

Examples

Get the Howcast category with id 2

Howcast::Client.new.category(2)


69
70
71
72
# File 'lib/howcast/client/category.rb', line 69

def category(id)
  response = establish_connection("categories/#{id}.xml")
  parse_single_category_xml(response.at(:category))
end