Created
December 8, 2018 17:23
-
-
Save gouf/252f118f2940568f98b86222fd8b7f8a to your computer and use it in GitHub Desktop.
処理順序がだいじなコードに yield_self を適用する (Ruby 2.5)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Ref: https://github.com/gouf/scholar_ps/blob/7b4b4bbe79197cbb2683af9cae95ada7e5418c46/ScholarPs/scraper/scraper.rb#L14 | |
def process! | |
html = | |
@watir.yield_self(&method(:login!)) | |
.yield_self(&method(:loan_id_confirm!)) | |
.yield_self(&method(:findout_loan_detail!)) | |
.yield_self(&:html) | |
detail_page = Nokogiri::HTML(html) | |
convert_to_hash_from_detail_page(detail_page) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment