seat_geek 0.10.1 → 0.10.2

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: 77fa0f82501ee76900802daf62901bf50d185df0
4
- data.tar.gz: 925db0245bb823cd0aebf7f2d66d669e4528855a
3
+ metadata.gz: 002e79d65fe42cd2af815a9b8bbab3d088010534
4
+ data.tar.gz: f57a92b757f3de09afb5e5d70c919b5fb109ea4b
5
5
  SHA512:
6
- metadata.gz: d682a7f2c463c694fbbe152cc0fc791d57b594324cd41ab4dd8d569b280b485e5eba33416221234aa37bf45b3a1901ce31d2f53aa5da8a4c36f8eed73d19e849
7
- data.tar.gz: e183ddb215e4744485d85286546a6015b1fcb89ec17a6e9d8c7dd2c8fbdbfeb9321268633c6014e5231e12433672256af4d2c7c710367a964fc7efd33e4aac81
6
+ metadata.gz: f5bc6a1fe24904590cff4d6f9d98fb4b2925f541a1f1b26d80bc2e3aa8f2018851012a98755bbae414b13f68c394d9f2ead7dd8c7b3a6ee0cccf921cde9ab22f
7
+ data.tar.gz: 2eafd82face8bfe92d54892d562f886275b68261f3535f84f68e1f45c5965b5d3f9627173895ddc96aa80317c43b41adfa4a3bbcd243158c92e1d2c65b8d4774
data/.gitignore CHANGED
@@ -9,3 +9,4 @@
9
9
  /tmp/
10
10
  /seat_geek-/
11
11
  /byebug_history/
12
+ /.byebug_history/
data/README.md CHANGED
@@ -73,7 +73,7 @@ SeatGeek.get_events()
73
73
 
74
74
  Accepts 1 parameter
75
75
 
76
- params = { month_of_the_year: '2016-03',
76
+ params = { travel_dates: {arrive: '2016-03-15', depart: '2016-03-19'},
77
77
  state: 'ny',
78
78
  attendee_count: num,
79
79
  event_type: 'taxonomie',
@@ -5,8 +5,8 @@ module SeatGeek
5
5
  if !base_url.match(/\?/)
6
6
  query = "?"
7
7
  end
8
- if options[:month_of_the_year]
9
- query = query + month_query(options[:month_of_the_year])
8
+ if options[:travel_dates]
9
+ query = query + travel_dates_query(options[:travel_dates])
10
10
  end
11
11
  if options[:state]
12
12
  query = query + location_query(options[:state])
@@ -15,26 +15,20 @@ module SeatGeek
15
15
  query = query + attendee_count_query(options[:attendee_count])
16
16
  end
17
17
  if options[:event_type]
18
- query = query + event_type_query(options[:event_type])
18
+ query = query + taxonomy_query(options[:event_type])
19
19
  end
20
20
  if options[:taxonomies]
21
- query = query + 'taxonomies.name=' + options[:taxonomies]
21
+ query = query + taxonomies
22
22
  end
23
23
  base_url + query
24
24
  end
25
25
 
26
26
  private
27
27
 
28
- # Events in April 2012
28
+ # Events in travel date
29
29
  # $ curl 'http://api.seatgeek.com/2/events?datetime_utc.gte=2012-04-01&datetime_utc.lte=2012-04-30'
30
- def self.month_query(year_month)
31
- year, month = year_month.split('-')
32
- year = year.to_i
33
- month = month.to_i
34
- first_day_of_month = Date.civil(year, month, 1).strftime('%F')
35
- last_day_of_month = Date.civil(year, month, -1).strftime('%F')
36
-
37
- "&datetime_utc.gte=#{first_day_of_month}&datetime_utc.lte=#{last_day_of_month}"
30
+ def self.travel_dates_query(travel_dates)
31
+ "&datetime_utc.gte=#{travel_dates[:arrive]}&datetime_utc.lte=#{travel_dates[:depart]}"
38
32
  end
39
33
 
40
34
  # Events in NY state
@@ -50,8 +44,9 @@ module SeatGeek
50
44
 
51
45
  # Sporting Events
52
46
  # $ curl 'http://api.seatgeek.com/2/events?taxonomies.name=sports'
53
- def self.event_type_query(type)
47
+ def self.taxonomy_query(type)
54
48
  "&taxonomies.name=#{type}"
55
49
  end
50
+
56
51
  end
57
52
  end
@@ -1,3 +1,3 @@
1
1
  module SeatGeek
2
- VERSION = "0.10.1"
2
+ VERSION = "0.10.2"
3
3
  end
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.10.1
4
+ version: 0.10.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Moon
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-01-27 00:00:00.000000000 Z
11
+ date: 2016-01-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler