seat_geek 0.2.7 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b685f855fb3c5fefc9017a8a91b031e3276ba5ab
4
- data.tar.gz: b62b0314ab2b302006740cfafa9662eeca7cefab
3
+ metadata.gz: faea6a9b543013e48e06b200088b1ff14ed9b1d4
4
+ data.tar.gz: b7b8bdb657c1e951f7e9d56f58a43b0b19779137
5
5
  SHA512:
6
- metadata.gz: 82c917c1424d3001687719963b2140471639c3f5ad95c521e3969f89ca8c8b39fe631461568b482b650f0033eb1da0f0a345b89d969e2db72d51e8e017a7b7bd
7
- data.tar.gz: b73d9136df117690fb5a73dd316e1bb6c31aafebe60ecb0ee855b207d5a91114d90fd7898a11bc0c160b286ebc9f88ef11d36967e671f3ad9d4a146ddc658cc4
6
+ metadata.gz: ec31780fe7c2eb587b73119b4618cce32ce6f373a8c0c1df554a67574e2eb58b30c6070cc5d1aba4b0873e681327c6ac17d85d174b4409bbbf1f32d03dbf6a4a
7
+ data.tar.gz: f4326c59534b11ad7f2ba7a5f7066c0345ad1906d6fba0294b9fab6f106c1acd213b3f700a22d7c51a8c43fd00b45ec95696ea5ef58b11c351b4b8d37517b71b
@@ -7,15 +7,12 @@ module SeatGeek
7
7
  query = month_query(options[:month_of_the_year])
8
8
  end
9
9
  if options[:state]
10
- query = '?' unless query.match(/\?/)
11
10
  query = query + location_query(options[:state])
12
11
  end
13
12
  if options[:attendee_count]
14
- query = '?' unless query.match(/\?/)
15
13
  query = query + attendee_count_query(options[:attendee_count])
16
14
  end
17
15
  if options[:event_type]
18
- query = '?' unless query.match(/\?/)
19
16
  query = query + event_type_query(options[:event_type])
20
17
  end
21
18
  options[:base_url] + query
@@ -32,7 +29,7 @@ module SeatGeek
32
29
  first_day_of_month = Date.civil(year, month, 1).strftime('%F')
33
30
  last_day_of_month = Date.civil(year, month, -1).strftime('%F')
34
31
 
35
- "?datetime_utc.gte=#{first_day_of_month}&datetime_utc.lte=#{last_day_of_month}"
32
+ "&datetime_utc.gte=#{first_day_of_month}&datetime_utc.lte=#{last_day_of_month}"
36
33
  end
37
34
 
38
35
  # Events in NY state
@@ -1,3 +1,3 @@
1
1
  module SeatGeek
2
- VERSION = "0.2.7"
2
+ VERSION = "0.3.0"
3
3
  end
data/lib/seat_geek.rb CHANGED
@@ -5,9 +5,10 @@ require 'oj'
5
5
 
6
6
  module SeatGeek
7
7
  extend self
8
+ PUBLIC_API_URL = 'http://api.seatgeek.com/2'
8
9
 
9
- def get_events(base_url: nil, month_of_the_year: nil, state: nil, attendee_count: nil, event_type: nil)
10
- @base_url = base_url || seatgeek_base_url
10
+ def self.get_events(month_of_the_year: nil, state: nil, attendee_count: nil, event_type: nil, seat_geek_partner_id:)
11
+ @base_url = PUBLIC_API_URL + "/events?aid#{seat_geek_partner_id}"
11
12
  @month_of_the_year = month_of_the_year
12
13
  @state = state
13
14
  @attendee_count = attendee_count
@@ -16,9 +17,8 @@ module SeatGeek
16
17
  parse_response(typhoeus_request.body)
17
18
  end
18
19
 
19
- #taxonomies -> events categories
20
- def get_event_types
21
- @base_url = seatgeek_taxonomies_url
20
+ def self.get_taxonomies
21
+ @base_url = PUBLIC_API_URL + '/taxonomies'
22
22
  @month_of_the_year = nil
23
23
  @state = nil
24
24
  @attendee_count = nil
@@ -27,11 +27,23 @@ module SeatGeek
27
27
  parse_response(typhoeus_request.body)
28
28
  end
29
29
 
30
+ #TODO incomplete
31
+ #GET http://api.seatgeek.com/2/recommendations
32
+
33
+ def self.get_recommendations(client_key:)
34
+ @base_url = PUBLIC_API_URL + '/recommendations'
35
+ parse_response(typhoeus_request.body)
36
+ end
37
+
30
38
  private
31
39
 
32
40
  attr_accessor :month_of_the_year, :state, :attendee_count, :event_type, :base_url
33
41
 
34
- def build_url
42
+ # Instead of BuildQuery what if it's the Method name?
43
+ # E.G Recommendations.build(options)
44
+ # E.G Events.build(options)
45
+ # This way each build could have their own custom settings
46
+ def build_url(url)
35
47
  BuildQuery.build(options)
36
48
  end
37
49
 
@@ -46,14 +58,6 @@ module SeatGeek
46
58
  Oj.load(json_string)
47
59
  end
48
60
 
49
- def seatgeek_base_url
50
- 'http://api.seatgeek.com/2/events'
51
- end
52
-
53
- def seatgeek_taxonomies_url
54
- 'http://api.seatgeek.com/2/taxonomies'
55
- end
56
-
57
61
  def options
58
62
  {
59
63
  base_url: base_url,
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: seat_geek
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.7
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Moon
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-12-15 00:00:00.000000000 Z
11
+ date: 2015-12-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler