zvents 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 18b57a5c9e9a710a1827b877d1a9815348ee801e
4
- data.tar.gz: 77900949e0f5d0b7d1d29123fb7f709cbb609421
3
+ metadata.gz: efd1770a8a8fe582a41ef6a055d75e79b9f91cb6
4
+ data.tar.gz: fb3ce640d613f342fa321923d415e449a1b13052
5
5
  SHA512:
6
- metadata.gz: a29ae1efa37cca7e5f97dbfa14745a2584e3d9ec1f4b16e99fb0b726ee34f746ff07c3f9260154bd4a2f9718fdf91ec526d86c8610507ed7d42d8f3fcabf932f
7
- data.tar.gz: 6a7fbd23d3ab397253d327e31c99aa14cad44134ecdb5762a8090419c907f3d156587b40288b8a6e0b711227911eb484f6709ee43f8dc1d652c304897c0c1d74
6
+ metadata.gz: 65b22899ad3e7ad18e7d60fc822b56ad2e97adc3172866517625c27f9dfb4d36ae141388ca1b33ad6b87fa18f9611b20c25d584e364bf1f0c7f3a65596daeb80
7
+ data.tar.gz: f91fcf630a129a97e742b69b72460c59c23259a3320550ae9c2500848fa68eda25c353cd511d070be92477e0b23caf7a3c24adcbc2501967d5a602db2d2dccd1
@@ -1,4 +1,7 @@
1
1
  === 0.1.0
2
2
  - Search API endpoint
3
3
  - Event find by id endpoint implemented
4
- - Venue find by id endpoint implemented
4
+ - Venue find by id endpoint implemented
5
+
6
+ === 0.1.1
7
+ - SearchResults event function optimized
@@ -6,11 +6,16 @@ module Zvents
6
6
 
7
7
  attribute :events, Array[Event]
8
8
  attribute :venues, Array[Venue]
9
-
9
+
10
10
  def events
11
- unless @venues_initialized
11
+ unless @venues_initialized
12
+ venue_hash = {} # A hash allows for this method to be run in linear time
13
+ # at the cost of space
14
+ @venues.each do |venue|
15
+ venue_hash[venue.id] = venue
16
+ end
12
17
  @events.each do |event|
13
- event.venue = @venues.detect{|venue| venue.id == event.venue_id}
18
+ event.venue = venue_hash[event.venue_id]
14
19
  end
15
20
  end
16
21
  @venues_initialized = true
@@ -1,3 +1,3 @@
1
1
  module Zvents
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zvents
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Austin Fonacier
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-07-24 00:00:00.000000000 Z
12
+ date: 2014-07-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler