Top Level Namespace

Defined Under Namespace

Modules: TreePeople Classes: Event, Scraper

Instance Method Summary collapse

Instance Method Details

#categoryObject



1
2
3
4
5
6
# File 'lib/tree_people/category.rb', line 1

def category
  options_for_categories
  select_option("category")
  list_selection_events
  event_details
end

#day_of_weekObject



1
2
3
4
5
6
# File 'lib/tree_people/day_of_week.rb', line 1

def day_of_week
  options_for_day
  select_option("day")
  list_selection_events
  event_details
end

#get_all_eventsObject



7
8
9
10
11
# File 'lib/tree_people/all_events.rb', line 7

def get_all_events
  Event.all.each do |event|
    @available_options << event
  end
end

#list_allObject



1
2
3
4
5
# File 'lib/tree_people/all_events.rb', line 1

def list_all
  get_all_events
  list_selection_events
  event_details
end

#locationObject



1
2
3
4
5
6
# File 'lib/tree_people/location.rb', line 1

def location
  options_for_locations
  select_option("location")
  list_selection_events
  event_details
end

#options_for_categoriesObject



8
9
10
11
12
# File 'lib/tree_people/category.rb', line 8

def options_for_categories
  puts "We offer the following types of events:"
  categories = Event.all.collect{|event| event.category}.uniq
  options(categories)
end

#options_for_dayObject



8
9
10
11
12
# File 'lib/tree_people/day_of_week.rb', line 8

def options_for_day
  puts "We have upcoming events on the following days:"
  days = Event.all.collect{|event| event.day}.uniq
  options(days)
end

#options_for_locationsObject



8
9
10
11
12
# File 'lib/tree_people/location.rb', line 8

def options_for_locations
  puts "We have upcoming events at the following locations:"
  locations = Event.all.collect{|event| event.location}.uniq
  options(locations)
end

#options_for_timeObject



8
9
10
11
12
# File 'lib/tree_people/time_of_day.rb', line 8

def options_for_time
  puts "We have events upcoming during the following times of the day:"
  times = Event.all.collect{|event| event.time_of_day}.uniq
  options(times)
end

#time_of_dayObject



1
2
3
4
5
6
# File 'lib/tree_people/time_of_day.rb', line 1

def time_of_day
  options_for_time
  select_option("time of day")
  list_selection_events
  event_details
end