Class: Help

Inherits:
Object
  • Object
show all
Defined in:
lib/before_tickets.rb

Class Method Summary collapse

Class Method Details

.allObject



39
40
41
42
43
44
# File 'lib/before_tickets.rb', line 39

def self.all
  DATA['steps'].each do |row|
    puts_data_splitting_by_newline(row)
  end
  HIHY
end

.meObject



22
23
24
25
26
# File 'lib/before_tickets.rb', line 22

def self.me
  data = DATA['steps'].sample
  puts_data_splitting_by_newline(data)
  HIHY
end

.search(word) ⇒ Object



28
29
30
31
32
33
34
35
36
37
# File 'lib/before_tickets.rb', line 28

def self.search(word)
  found_data = false
  DATA['steps'].each do |row|
    if row.downcase.include?(word.downcase)
      puts_data_splitting_by_newline(row)
      found_data = true
    end
  end
  found_data ? HIHY : 'Sorry, I couldnt find any quote with that word'
end