Skip to content

Commit

Permalink
[#7] Use keyword argument to initislize service
Browse files Browse the repository at this point in the history
  • Loading branch information
malparty committed Jun 30, 2021
1 parent 66ee33a commit 9d31857
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/services/google_service/parser_service.rb
Expand Up @@ -6,10 +6,11 @@ class ParserService

NON_ADS_RESULT_SELECTOR = 'a[data-ved]:not([role]):not([jsaction]):not(.adwords):not(.footer-links)'

def initialize(html_response)
def initialize(html_response:)
raise ArgumentError, 'response.body cannot be nil' if html_response.body.blank?

@html = html_response

@document = Nokogiri::HTML.parse(html_response)

# Add a class to all AdWords link for easier manipulation
Expand Down

0 comments on commit 9d31857

Please sign in to comment.