seat_geek 0.9.0 → 0.10.0

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: 6ce5c12eb1e98d94debc10b1fdb2ddd423af3cbe
4
- data.tar.gz: f63d8b811f9dfa195ac031ac4d02d0f985f310a9
3
+ metadata.gz: 95e5020ae2e90d18075fbecd9dbf837a463d973f
4
+ data.tar.gz: 13c8bb1e08df85bbb089ea9f22728bf521b09abd
5
5
  SHA512:
6
- metadata.gz: a8b8f54466a4b1eecb150f28b66faa8219b3838d30a537a63a3234e7ffecdcefbaea0221a1707c1954b5c492896d1fbbcbdb734f122ee910042f2016572dcd88
7
- data.tar.gz: 00d27260de5bfbe7fe845c3df013eab58fadc5348c5060928241b9f8e24ff48dd0be81d40c202f53fffbd1a8d105d81a0d6cce4db0e73a9cd948f79ebc6d7154
6
+ metadata.gz: 3ed597831171b62bb1d004aa1a3a63aa9501475323fb9462c0d2ab51b99460fbb50cbcb57a75c6a7f79afb9654e0173c7a11ccc45027b6f951f3e06b049d1e1c
7
+ data.tar.gz: e0f13e1d5463800df33a9cd463e55df2ae46afc0120b674b0e88f3b4ad1fb8a251fc3dfc0eeb26321d9823093ca8da7947ee934a6f38f15be4f6e064b10b033e
@@ -1,8 +1,8 @@
1
1
  module SeatGeek
2
2
  module Taxonomies
3
3
  class Sports
4
- def initialize(sub_taxonomies:)
5
- @taxonomies = sub_taxonomies
4
+ def initialize(taxonomies:)
5
+ @taxonomies = taxonomies
6
6
  end
7
7
 
8
8
  def all
@@ -69,6 +69,7 @@ module SeatGeek
69
69
  attr_accessor :parent_id, :taxonomies
70
70
 
71
71
  def build_child_tree
72
+ # parent_ids.each do |parent_id|
72
73
  parent_object = taxonomies.detect { |taxonomy| taxonomy['id'] == parent_id }
73
74
 
74
75
  child_taxonomies = [parent_object]
@@ -76,6 +77,7 @@ module SeatGeek
76
77
  child_taxonomies << taxonomy if taxonomy['parent_id'] == parent_id
77
78
  end
78
79
  child_taxonomies
80
+ # end
79
81
  end
80
82
  end
81
83
  end
@@ -31,16 +31,19 @@ module SeatGeek
31
31
  parent_ids.each do |parent_id|
32
32
  parent_object = taxonomies.detect { |taxonomy| taxonomy['id'] == parent_id }
33
33
 
34
- sub_taxonomies = [parent_object]
34
+ child_taxonomies = [parent_object]
35
35
  taxonomies.each do |taxonomy|
36
- sub_taxonomies << taxonomy if taxonomy['parent_id'].to_s[0] == parent_id.to_s[0]
36
+ child_taxonomies << taxonomy if taxonomy['parent_id'].to_s[0] == parent_id.to_s[0]
37
37
  end
38
38
 
39
- klass = { 'sports' => SeatGeek::Taxonomies::Sports, 'concert' => SeatGeek::Taxonomies::Concert, 'theater' => SeatGeek::Taxonomies::Theater }
40
- finished_tree[parent_object['name'].to_sym] = klass[parent_object['name']].new(sub_taxonomies: sub_taxonomies)
39
+ finished_tree[parent_object['name'].to_sym] = tree_klass[parent_object['name']].new(taxonomies: child_taxonomies)
41
40
  end
42
41
  end
43
42
 
43
+ def tree_klass
44
+ { 'sports' => SeatGeek::Taxonomies::Sports, 'concert' => SeatGeek::Taxonomies::Concert, 'theater' => SeatGeek::Taxonomies::Theater }
45
+ end
46
+
44
47
  def finished_tree
45
48
  @finished_tree ||= { sports: nil, concert: nil, theater: nil }
46
49
  end
@@ -1,3 +1,3 @@
1
1
  module SeatGeek
2
- VERSION = "0.9.0"
2
+ VERSION = "0.10.0"
3
3
  end
data/lib/seat_geek.rb CHANGED
@@ -35,6 +35,22 @@ module SeatGeek
35
35
  SeatGeek::Taxonomies::Tree.new(parent_ids: [SPORTS_ID, CONCERT_ID, THEATRE_ID], taxonomies: taxonomies)
36
36
  end
37
37
 
38
+ def self.states
39
+ @state ||= [{:state_name=>"AL"}, {:state_name=>"MT"}, {:state_name=>"AK"}, {:state_name=>"NE"},
40
+ {:state_name=>"AZ"}, {:state_name=>"NV"}, {:state_name=>"AR"}, {:state_name=>"NH"},
41
+ {:state_name=>"CA"}, {:state_name=>"NJ"}, {:state_name=>"CO"}, {:state_name=>"NM"},
42
+ {:state_name=>"CT"}, {:state_name=>"NY"}, {:state_name=>"DE"}, {:state_name=>"NC"},
43
+ {:state_name=>"FL"}, {:state_name=>"ND"}, {:state_name=>"GA"}, {:state_name=>"OH"},
44
+ {:state_name=>"HI"}, {:state_name=>"OK"}, {:state_name=>"ID"}, {:state_name=>"OR"},
45
+ {:state_name=>"IL"}, {:state_name=>"PA"}, {:state_name=>"IN"}, {:state_name=>"RI"},
46
+ {:state_name=>"IA"}, {:state_name=>"SC"}, {:state_name=>"KS"}, {:state_name=>"SD"},
47
+ {:state_name=>"KY"}, {:state_name=>"TN"}, {:state_name=>"LA"}, {:state_name=>"TX"},
48
+ {:state_name=>"ME"}, {:state_name=>"UT"}, {:state_name=>"MD"}, {:state_name=>"VT"},
49
+ {:state_name=>"MA"}, {:state_name=>"VA"}, {:state_name=>"MI"}, {:state_name=>"WA"},
50
+ {:state_name=>"MN"}, {:state_name=>"WV"}, {:state_name=>"MS"}, {:state_name=>"WI"},
51
+ {:state_name=>"MO"}, {:state_name=>"WY"}].sort_by { |x| x[:state_name] }
52
+ end
53
+
38
54
  #TODO Need to think this through
39
55
  # not sure how to get recommendations or what we should get recommendations
40
56
  # for
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.9.0
4
+ version: 0.10.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: 2016-01-24 00:00:00.000000000 Z
11
+ date: 2016-01-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -144,7 +144,6 @@ files:
144
144
  - lib/seat_geek/Taxonomies/theater.rb
145
145
  - lib/seat_geek/Taxonomies/tree.rb
146
146
  - lib/seat_geek/build_query.rb
147
- - lib/seat_geek/taxonomy.rb
148
147
  - lib/seat_geek/version.rb
149
148
  - seat_geek.gemspec
150
149
  homepage: https://github.com/jmoon90/seat_geek
File without changes