Class: Camdram::Show
Instance Attribute Summary collapse
-
#author ⇒ Object
Returns the value of attribute author.
-
#category ⇒ Object
Returns the value of attribute category.
-
#description ⇒ Object
Returns the value of attribute description.
-
#image ⇒ Object
Returns the value of attribute image.
-
#name ⇒ Object
Returns the value of attribute name.
-
#online_booking_url ⇒ Object
Returns the value of attribute online_booking_url.
-
#other_society ⇒ Object
Returns the value of attribute other_society.
-
#other_venue ⇒ Object
Returns the value of attribute other_venue.
-
#performances ⇒ Object
Returns the value of attribute performances.
-
#prices ⇒ Object
Returns the value of attribute prices.
-
#slug ⇒ Object
Returns the value of attribute slug.
-
#society ⇒ Object
Returns the value of attribute society.
-
#venue ⇒ Object
Returns the value of attribute venue.
Attributes included from API
Attributes inherited from Base
Class Method Summary collapse
-
.url ⇒ String
Returns the URL stub assocaited with all shows.
Instance Method Summary collapse
-
#info ⇒ Hash
Return a hash of the shows's attributes.
-
#initialize(options = {}) ⇒ Camdram::Show
constructor
Instantiate a new Show object from a JSON hash.
-
#roles ⇒ Array
Gets an array of roles associated with the shows.
-
#url_slug ⇒ String
Returns the URL+slug of the show.
Methods included from API
Constructor Details
#initialize(options = {}) ⇒ Camdram::Show
Instantiate a new Show object from a JSON hash
18 19 20 21 22 23 24 |
# File 'lib/camdram/show.rb', line 18 def initialize( = {}) super() @society = Organisation.new( @society ) unless @society.nil? @venue = Venue.new( @venue ) unless @venue.nil? @performances = split_object( @performances, Performance ) unless @performances.nil? @image = Image.new( @image ) unless @image.nil? end |
Instance Attribute Details
#author ⇒ Object
Returns the value of attribute author.
12 13 14 |
# File 'lib/camdram/show.rb', line 12 def @author end |
#category ⇒ Object
Returns the value of attribute category.
12 13 14 |
# File 'lib/camdram/show.rb', line 12 def category @category end |
#description ⇒ Object
Returns the value of attribute description.
12 13 14 |
# File 'lib/camdram/show.rb', line 12 def description @description end |
#image ⇒ Object
Returns the value of attribute image.
12 13 14 |
# File 'lib/camdram/show.rb', line 12 def image @image end |
#name ⇒ Object
Returns the value of attribute name.
12 13 14 |
# File 'lib/camdram/show.rb', line 12 def name @name end |
#online_booking_url ⇒ Object
Returns the value of attribute online_booking_url.
12 13 14 |
# File 'lib/camdram/show.rb', line 12 def online_booking_url @online_booking_url end |
#other_society ⇒ Object
Returns the value of attribute other_society.
12 13 14 |
# File 'lib/camdram/show.rb', line 12 def other_society @other_society end |
#other_venue ⇒ Object
Returns the value of attribute other_venue.
12 13 14 |
# File 'lib/camdram/show.rb', line 12 def other_venue @other_venue end |
#performances ⇒ Object
Returns the value of attribute performances.
12 13 14 |
# File 'lib/camdram/show.rb', line 12 def performances @performances end |
#prices ⇒ Object
Returns the value of attribute prices.
12 13 14 |
# File 'lib/camdram/show.rb', line 12 def prices @prices end |
#slug ⇒ Object
Returns the value of attribute slug.
12 13 14 |
# File 'lib/camdram/show.rb', line 12 def slug @slug end |
#society ⇒ Object
Returns the value of attribute society.
12 13 14 |
# File 'lib/camdram/show.rb', line 12 def society @society end |
#venue ⇒ Object
Returns the value of attribute venue.
12 13 14 |
# File 'lib/camdram/show.rb', line 12 def venue @venue end |
Class Method Details
.url ⇒ String
Returns the URL stub assocaited with all shows
67 68 69 |
# File 'lib/camdram/show.rb', line 67 def self.url '/shows' end |
Instance Method Details
#info ⇒ Hash
Return a hash of the shows's attributes
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/camdram/show.rb', line 38 def info { id: id, name: name, description: description, image: image, slug: slug, author: , prices: prices, other_venue: other_venue, other_society: other_society, category: category, performances: performances, online_booking_url: online_booking_url, society: society, venue: venue, } end |
#roles ⇒ Array
Gets an array of roles associated with the shows
29 30 31 32 33 |
# File 'lib/camdram/show.rb', line 29 def roles roles_url = "#{self.class.url}/#{slug}/roles.json" response = get(roles_url) split_object( response, Role ) end |
#url_slug ⇒ String
Returns the URL+slug of the show
60 61 62 |
# File 'lib/camdram/show.rb', line 60 def url_slug "#{self.class.url}/#{slug}.json" end |