Class: Eventify::Provider::Ticketpro
- Defined in:
- lib/eventify/provider/ticketpro.rb
Constant Summary collapse
- URL =
"http://www.ticketpro.ee/jnp/rss/index.xml"
Constants inherited from Base
Instance Attribute Summary
Attributes inherited from Base
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(event) ⇒ Ticketpro
constructor
A new instance of Ticketpro.
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
.fetch ⇒ Object
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 |