Skip to content

Commit

Permalink
Add diary functionality to venues & societies
Browse files Browse the repository at this point in the history
  • Loading branch information
CHTJonas committed Dec 7, 2018
1 parent f7b7876 commit a9514b3
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
10 changes: 10 additions & 0 deletions lib/camdram/organisation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
require 'camdram/image'
require 'camdram/news'
require 'camdram/show'
require 'camdram/diary'

module Camdram
class Organisation < Base
Expand Down Expand Up @@ -51,6 +52,15 @@ def shows
split_object( response, Show )
end

# Gets a diary object which contains an array of upcoming calendar events for the organisation
#
# @return [Camdram::Diary] A Diary object.
def diary()
url = "#{self.class.url}/#{slug}/diary.json"
response = get(url)
Diary.new(response)
end

# Returns the URL+slug of the organisation
#
# @return [String] The full URL and slug.
Expand Down
10 changes: 10 additions & 0 deletions lib/camdram/venue.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
require 'camdram/api'
require 'camdram/news'
require 'camdram/show'
require 'camdram/diary'

module Camdram
class Venue < Base
Expand Down Expand Up @@ -45,6 +46,15 @@ def shows
split_object( response, Show )
end

# Gets a diary object which contains an array of upcoming calendar events for the venue
#
# @return [Camdram::Diary] A Diary object.
def diary()
url = "#{self.class.url}/#{slug}/diary.json"
response = get(url)
Diary.new(response)
end

# Returns the URL+slug of the venue
#
# @return [String] The full URL and slug.
Expand Down
2 changes: 1 addition & 1 deletion lib/camdram/version.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Camdram
VERSION = '1.2.0'
VERSION = '1.2.1'
BASE_URL = 'https://www.camdram.net'
end

0 comments on commit a9514b3

Please sign in to comment.