class Planvine::PlanvineAPI

Public Class Methods

new(api_key) click to toggle source
# File lib/planvine/planvine_api.rb, line 7
def initialize(api_key)
  @api_key = api_key
end

Public Instance Methods

categories() click to toggle source
# File lib/planvine/planvine_api.rb, line 17
def categories
  categories = self.class.get("/category?api_key=#{@api_key}")
  categories["data"].map do |category|
    CategoriesBuilder.build(category, self)
  end
end
category_events(id, results_count=100) click to toggle source
# File lib/planvine/planvine_api.rb, line 24
def category_events(id, results_count=100)
  self.class.get("/category/#{id}/events?api_key=#{@api_key}&results_per_page=#{results_count}")["data"]
end
event(id) click to toggle source
# File lib/planvine/planvine_api.rb, line 28
def event(id)
  self.class.get("/event/#{id}?api_key=#{@api_key}")["data"]
end
events() click to toggle source
# File lib/planvine/planvine_api.rb, line 11
def events
  self.class.get("/event?api_key=#{@api_key}")["data"].map do |event|
    EventsBuilder.build(event)
  end
end
venue(id) click to toggle source
# File lib/planvine/planvine_api.rb, line 32
def venue(id)
  Venue.new(self.class.get("/venue/#{id}?api_key=#{@api_key}")["data"])
end