class Camdram::Venue

Attributes

address[RW]
college[RW]
description[RW]
facebook_id[RW]
latitude[RW]
longitude[RW]
name[RW]
short_name[RW]
slug[RW]
twitter_id[RW]

Public Class Methods

url() click to toggle source

Returns the URL stub assocaited with all venues

@return [String] The URL stub.

# File lib/camdram/venue.rb, line 68
def self.url
  '/venues'
end

Public Instance Methods

diary() click to toggle source

Gets a diary object which contains an array of upcoming calendar events for the venue

@return [Camdram::Diary] A Diary object.

# File lib/camdram/venue.rb, line 52
def diary()
  url = "#{self.class.url}/#{slug}/diary.json"
  response = get(url)
  Diary.new(response)
end
info() click to toggle source

Return a hash of the venue's attributes

@return [Hash] Hash with symbolized keys.

# File lib/camdram/venue.rb, line 15
def info
  {
    id: id,
    name: name,
    description: description,
    facebook_id: facebook_id,
    twitter_id: twitter_id,
    short_name: short_name,
    college: college,
    slug: slug,
    address: address,
    latitude: latitude,
    longitude: longitude,
  }
end
news() click to toggle source

Gets an array of the venue's news items

@return [Array] An array of News objects.

# File lib/camdram/venue.rb, line 34
def news
  news_url = "#{self.class.url}/#{slug}/news.json"
  response = get(news_url)
  split_object( response, News )
end
shows() click to toggle source

Gets an array of the venue's upcoming shows

@return [Array] An array of Show objects.

# File lib/camdram/venue.rb, line 43
def shows
  shows_url = "#{self.class.url}/#{slug}/shows.json"
  response = get(shows_url)
  split_object( response, Show )
end
url_slug() click to toggle source

Returns the URL+slug of the venue

@return [String] The full URL and slug.

# File lib/camdram/venue.rb, line 61
def url_slug
  "#{self.class.url}/#{slug}.json"
end