Class: Camdram::Venue

Inherits:
Base
  • Object
show all
Includes:
API
Defined in:
lib/camdram/venue.rb

Instance Attribute Summary collapse

Attributes included from API

#http

Attributes inherited from Base

#id

Class Method Summary collapse

Instance Method Summary collapse

Methods included from API

#initialize, #update!

Methods inherited from Base

#initialize

Instance Attribute Details

#addressObject

Returns the value of attribute address.



10
11
12
# File 'lib/camdram/venue.rb', line 10

def address
  @address
end

#collegeObject

Returns the value of attribute college.



10
11
12
# File 'lib/camdram/venue.rb', line 10

def college
  @college
end

#descriptionObject

Returns the value of attribute description.



10
11
12
# File 'lib/camdram/venue.rb', line 10

def description
  @description
end

#facebook_idObject

Returns the value of attribute facebook_id.



10
11
12
# File 'lib/camdram/venue.rb', line 10

def facebook_id
  @facebook_id
end

#latitudeObject

Returns the value of attribute latitude.



10
11
12
# File 'lib/camdram/venue.rb', line 10

def latitude
  @latitude
end

#longitudeObject

Returns the value of attribute longitude.



10
11
12
# File 'lib/camdram/venue.rb', line 10

def longitude
  @longitude
end

#nameObject

Returns the value of attribute name.



10
11
12
# File 'lib/camdram/venue.rb', line 10

def name
  @name
end

#short_nameObject

Returns the value of attribute short_name.



10
11
12
# File 'lib/camdram/venue.rb', line 10

def short_name
  @short_name
end

#slugObject

Returns the value of attribute slug.



10
11
12
# File 'lib/camdram/venue.rb', line 10

def slug
  @slug
end

#twitter_idObject

Returns the value of attribute twitter_id.



10
11
12
# File 'lib/camdram/venue.rb', line 10

def twitter_id
  @twitter_id
end

Class Method Details

.urlString

Returns the URL stub assocaited with all venues

Returns:

  • (String)

    The URL stub.



68
69
70
# File 'lib/camdram/venue.rb', line 68

def self.url
  '/venues'
end

Instance Method Details

#diaryCamdram::Diary

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

Returns:



52
53
54
55
56
# File 'lib/camdram/venue.rb', line 52

def diary()
  url = "#{self.class.url}/#{slug}/diary.json"
  response = get(url)
  Diary.new(response)
end

#infoHash

Return a hash of the venue's attributes

Returns:

  • (Hash)

    Hash with symbolized keys.



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# 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

#newsArray

Gets an array of the venue's news items

Returns:

  • (Array)

    An array of News objects.



34
35
36
37
38
# 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

#showsArray

Gets an array of the venue's upcoming shows

Returns:

  • (Array)

    An array of Show objects.



43
44
45
46
47
# 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_slugString

Returns the URL+slug of the venue

Returns:

  • (String)

    The full URL and slug.



61
62
63
# File 'lib/camdram/venue.rb', line 61

def url_slug
  "#{self.class.url}/#{slug}.json"
end