Class: Zvent::Performer
Overview
An object that represents a single venue from zvents
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
-
#id ⇒ Object
Returns the value of attribute id.
-
#images ⇒ Object
Returns the value of attribute images.
-
#name ⇒ Object
Returns the value of attribute name.
-
#url ⇒ Object
Returns the value of attribute url.
-
#zurl ⇒ Object
Returns the value of attribute zurl.
Instance Method Summary collapse
-
#images? ⇒ Boolean
Does the performer have any images.
-
#initialize(performer_hash) ⇒ Performer
constructor
A new instance of Performer.
- #timezone? ⇒ Boolean
-
#tz_timezone ⇒ Object
Returns the tz timezone object.
Methods inherited from Base
Constructor Details
#initialize(performer_hash) ⇒ Performer
Returns a new instance of Performer.
6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/zvent/performer.rb', line 6 def initialize(performer_hash) performer_hash.each_pair do |key, value| begin self.send("#{key}=", value) rescue NoMethodError => e #do nothing end end # Zvents Partner API self.zurl ||= performer_hash['link'] self.description ||= performer_hash['summary'] end |
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
4 5 6 |
# File 'lib/zvent/performer.rb', line 4 def description @description end |
#id ⇒ Object
Returns the value of attribute id.
4 5 6 |
# File 'lib/zvent/performer.rb', line 4 def id @id end |
#images ⇒ Object
Returns the value of attribute images.
4 5 6 |
# File 'lib/zvent/performer.rb', line 4 def images @images end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/zvent/performer.rb', line 4 def name @name end |
#url ⇒ Object
Returns the value of attribute url.
4 5 6 |
# File 'lib/zvent/performer.rb', line 4 def url @url end |
#zurl ⇒ Object
Returns the value of attribute zurl.
4 5 6 |
# File 'lib/zvent/performer.rb', line 4 def zurl @zurl end |
Instance Method Details
#images? ⇒ Boolean
Does the performer have any images
21 |
# File 'lib/zvent/performer.rb', line 21 def images? ; !(@images.nil? || @images.empty?) ; end |
#timezone? ⇒ Boolean
23 |
# File 'lib/zvent/performer.rb', line 23 def timezone? ; !(@timezone.nil? || @timezone.empty?) ; end |
#tz_timezone ⇒ Object
Returns the tz timezone object
26 |
# File 'lib/zvent/performer.rb', line 26 def tz_timezone ; timezone? ? TZInfo::Timezone.get(@timezone) : nil ; end |