lib/hacker_news/article.rb
# Allows the user to search for articles by keyword
Allows the user to search for articles by keyword
Allows the user to search for articles by keyword
def find_by_keyword(type, value)
        finder = filter_by_type(type).select do |e|
            e&.title&.downcase&.include?(value.downcase) || e&.text&.downcase&.include?(value.downcase)
          end
        finder.uniq
      end
def find_by_keyword ( type , value ) finder = filter_by_type ( type ) . select do | e | e &. title &. downcase &. include? ( value . downcase ) || e &. text &. downcase &. include? ( value . downcase ) end finder . uniq end
Allows the user to search for articles by keyword
Allows the user to search for articles by keyword
# Returns articles and removes duplicates //fixme
type
value