GithubHelp home page GithubHelp logo

adhrinae / heoncheck-hunter-sinatra Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 20 KB

Used book finder for Aladin's used book stores

License: MIT License

Ruby 43.34% JavaScript 10.65% CSS 7.00% HTML 39.01%

heoncheck-hunter-sinatra's People

Watchers

 avatar

heoncheck-hunter-sinatra's Issues

검색하고자 하는 매장을 취사선택

  • 매장 한개만 검색할 때는 직접 알라딘 홈페이지를 가면 됨
  • 하지만 특정 매장을 사용자가 직접 몇 개 고른다고 하면 유용할 듯 (어차피 서울 모든 매장을 다 찾아도 거리가 있으니)

특정 검색어의 검색이 제대로 되지 않는 오류

  • 몇몇 검색어의 경우 처리 중간에 nil이 반환되는데, 이 nil에 strip 메서드가 작동하지 않아 NoMethodError 가 출력됨
  • 보통 '데이터베이스' 같이 조금 긴 문자열을 사용할 때 문제가 발생하는 것으로 보임
  • 에러가 발생할 때의 rescue 를 정의해 두고 예외처리

검색 로직 리팩토링 2

BookSearch 라는 한 클래스가 너무 많은 책임을 가지고 있다는 생각

  • Module 한개에 두세개의 클래스로 나뉘어져 있는 모습이 이상적이라 여겨짐
  • 검색 부분만 실행하는 클래스, 상점의 정보를 조회하고 가지는 클래스, 개별 책에 대한 검색 및 자료를 담는 클래스, 모든 정보를 종합하여 리턴하는 클래스 등

검색 로직 분리

  • SearchBook 클래스를 다른 파일로 분리
  • SearchBook 클래스의 find 메서드 기능별 분리 (상점별, 책 제목 별)
  • 검색 결과가 없는 경우의 처리 최적화

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.