Class: Zvent::Venue

Inherits:
Base show all
Defined in:
lib/zvent/venue.rb

Overview

An object that represents a single venue from zvents

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#get_resources

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

#addressObject

Returns the value of attribute address.



4
5
6
# File 'lib/zvent/venue.rb', line 4

def address
  @address
end

#cityObject

Returns the value of attribute city.



4
5
6
# File 'lib/zvent/venue.rb', line 4

def city
  @city
end

#countryObject

Returns the value of attribute country.



4
5
6
# File 'lib/zvent/venue.rb', line 4

def country
  @country
end

#descriptionObject

Returns the value of attribute description.



4
5
6
# File 'lib/zvent/venue.rb', line 4

def description
  @description
end

#idObject

Returns the value of attribute id.



4
5
6
# File 'lib/zvent/venue.rb', line 4

def id
  @id
end

#imagesObject

Returns the value of attribute images.



4
5
6
# File 'lib/zvent/venue.rb', line 4

def images
  @images
end

#latitudeObject

Returns the value of attribute latitude.



4
5
6
# File 'lib/zvent/venue.rb', line 4

def latitude
  @latitude
end

#longitudeObject

Returns the value of attribute longitude.



4
5
6
# File 'lib/zvent/venue.rb', line 4

def longitude
  @longitude
end

#nameObject

Returns the value of attribute name.



4
5
6
# File 'lib/zvent/venue.rb', line 4

def name
  @name
end

#parent_idObject

Returns the value of attribute parent_id.



4
5
6
# File 'lib/zvent/venue.rb', line 4

def parent_id
  @parent_id
end

#phoneObject

Returns the value of attribute phone.



4
5
6
# File 'lib/zvent/venue.rb', line 4

def phone
  @phone
end

#privateObject

Returns the value of attribute private.



4
5
6
# File 'lib/zvent/venue.rb', line 4

def private
  @private
end

#stateObject

Returns the value of attribute state.



4
5
6
# File 'lib/zvent/venue.rb', line 4

def state
  @state
end

#timezoneObject

Returns the value of attribute timezone.



4
5
6
# File 'lib/zvent/venue.rb', line 4

def timezone
  @timezone
end

#typesObject

Returns the value of attribute types.



4
5
6
# File 'lib/zvent/venue.rb', line 4

def types
  @types
end

#urlObject

Returns the value of attribute url.



4
5
6
# File 'lib/zvent/venue.rb', line 4

def url
  @url
end

#zipObject

Returns the value of attribute zip.



4
5
6
# File 'lib/zvent/venue.rb', line 4

def zip
  @zip
end

#zurlObject

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

Returns:

  • (Boolean)


24
# File 'lib/zvent/venue.rb', line 24

def images? ; !(@images.nil? || @images.empty?) ; end

#timezone?Boolean

Returns:

  • (Boolean)


26
# File 'lib/zvent/venue.rb', line 26

def timezone? ; !(@timezone.nil? || @timezone.empty?) ; end

#tz_timezoneObject

Returns the tz timezone object



29
# File 'lib/zvent/venue.rb', line 29

def tz_timezone ;  timezone? ? TZInfo::Timezone.get(@timezone) : nil ; end