Class: SeatGeek::Taxonomies::Tree

Inherits:
Object
  • Object
show all
Defined in:
lib/seat_geek/taxonomies/tree.rb

Constant Summary collapse

FILE_PATH =
"/Users/johnmoon/Desktop/side_projects/seat_geek/lib/seat_geek/yaml/event_parent_id.yaml"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(parent_ids:, taxonomies:) ⇒ Tree

Returns a new instance of Tree.



5
6
7
8
9
# File 'lib/seat_geek/taxonomies/tree.rb', line 5

def initialize(parent_ids:, taxonomies:)
  @parent_ids = parent_ids
  @taxonomies = taxonomies
  build_tree
end

Instance Attribute Details

#parent_idsObject

Returns the value of attribute parent_ids.



27
28
29
# File 'lib/seat_geek/taxonomies/tree.rb', line 27

def parent_ids
  @parent_ids
end

#taxonomiesObject

Returns the value of attribute taxonomies.



27
28
29
# File 'lib/seat_geek/taxonomies/tree.rb', line 27

def taxonomies
  @taxonomies
end

Instance Method Details

#allObject



11
12
13
# File 'lib/seat_geek/taxonomies/tree.rb', line 11

def all
  finished_tree
end

#concertObject



19
20
21
# File 'lib/seat_geek/taxonomies/tree.rb', line 19

def concert
  finished_tree[:concert]
end

#sportsObject



15
16
17
# File 'lib/seat_geek/taxonomies/tree.rb', line 15

def sports
  finished_tree[:sports]
end

#theaterObject



23
24
25
# File 'lib/seat_geek/taxonomies/tree.rb', line 23

def theater
  finished_tree[:theater]
end