Class: Zvent::Performer

Inherits:
Base show all
Defined in:
lib/zvent/performer.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(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

#descriptionObject

Returns the value of attribute description.



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

def description
  @description
end

#idObject

Returns the value of attribute id.



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

def id
  @id
end

#imagesObject

Returns the value of attribute images.



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

def images
  @images
end

#nameObject

Returns the value of attribute name.



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

def name
  @name
end

#urlObject

Returns the value of attribute url.



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

def url
  @url
end

#zurlObject

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

Returns:

  • (Boolean)


21
# File 'lib/zvent/performer.rb', line 21

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

#timezone?Boolean

Returns:

  • (Boolean)


23
# File 'lib/zvent/performer.rb', line 23

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

#tz_timezoneObject

Returns the tz timezone object



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

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