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