Skip to content

Commit a9514b3

Browse files
committed
Add diary functionality to venues & societies
1 parent f7b7876 commit a9514b3

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

lib/camdram/organisation.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
require 'camdram/image'
44
require 'camdram/news'
55
require 'camdram/show'
6+
require 'camdram/diary'
67

78
module Camdram
89
class Organisation < Base
@@ -51,6 +52,15 @@ def shows
5152
split_object( response, Show )
5253
end
5354

55+
# Gets a diary object which contains an array of upcoming calendar events for the organisation
56+
#
57+
# @return [Camdram::Diary] A Diary object.
58+
def diary()
59+
url = "#{self.class.url}/#{slug}/diary.json"
60+
response = get(url)
61+
Diary.new(response)
62+
end
63+
5464
# Returns the URL+slug of the organisation
5565
#
5666
# @return [String] The full URL and slug.

lib/camdram/venue.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
require 'camdram/api'
33
require 'camdram/news'
44
require 'camdram/show'
5+
require 'camdram/diary'
56

67
module Camdram
78
class Venue < Base
@@ -45,6 +46,15 @@ def shows
4546
split_object( response, Show )
4647
end
4748

49+
# Gets a diary object which contains an array of upcoming calendar events for the venue
50+
#
51+
# @return [Camdram::Diary] A Diary object.
52+
def diary()
53+
url = "#{self.class.url}/#{slug}/diary.json"
54+
response = get(url)
55+
Diary.new(response)
56+
end
57+
4858
# Returns the URL+slug of the venue
4959
#
5060
# @return [String] The full URL and slug.

lib/camdram/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
module Camdram
2-
VERSION = '1.2.0'
2+
VERSION = '1.2.1'
33
BASE_URL = 'https://www.camdram.net'
44
end

0 commit comments

Comments
 (0)