lib/songkickr/event.rb in songkickr-0.4.0 vs lib/songkickr/event.rb in songkickr-0.4.1
- old
+ new
@@ -35,11 +35,11 @@
# "id": 3037536
# }
#
# http://www.songkick.com/developer/artist-search
class Event
- attr_accessor :popularity, :type, :display_name, :location, :start, :uri, :id, :performances, :status, :venue, :tickets_uri
+ attr_accessor :popularity, :type, :display_name, :location, :start, :uri, :id, :performances, :status, :venue, :tickets_uri, :series
def initialize(event_hash)
@popularity = event_hash["popularity"].to_f
@type = event_hash["type"]
@location = Songkickr::Location.new event_hash["location"]
@@ -49,9 +49,10 @@
@start = start_hash_to_datetime event_hash["start"]
@uri = event_hash["uri"]
@performances = parse_performance event_hash["performance"]
@id = event_hash["id"]
@tickets_uri = event_hash["ticketsUri"]
+ @series = event_hash["series"]["displayName"] if event_hash["series"] && event_hash["series"]["displayName"]
end
protected
# Takes the start hash and turns in into a DateTime object.