Class: Eventify::Provider::Ticketpro

Inherits:
Base
  • Object
show all
Defined in:
lib/eventify/provider/ticketpro.rb

Constant Summary collapse

URL =
"http://www.ticketpro.ee/jnp/rss/index.xml"

Constants inherited from Base

Base::MissingAttributeError

Instance Attribute Summary

Attributes inherited from Base

#date, #id, #link, #title

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#<=>, #==, #exists?, #hash, #provider, #save

Constructor Details

#initialize(event) ⇒ Ticketpro

Returns a new instance of Ticketpro.



8
9
10
11
12
# File 'lib/eventify/provider/ticketpro.rb', line 8

def initialize(event)
  super
  @id = @id.gsub(%r{/jnp/(ru|en)/}, "/jnp/")
  @link = @link.gsub(%r{/jnp/(ru|en)/}, "/jnp/")
end

Class Method Details

.fetchObject



15
16
17
18
# File 'lib/eventify/provider/ticketpro.rb', line 15

def fetch
  rss = SimpleRSS.parse open(URL)
  rss.entries.map { |entry| new id: entry.guid, title: entry.title, link: entry.link, date: entry.pubDate }
end