Class: OKCupid::SearchPaginationParser

Inherits:
Mechanize::Page
  • Object
show all
Defined in:
lib/lonely_coder/search/search_pagination_parser.rb

Overview

OKCupid’s ajax pagination follows pjax pattern and returns json with page fragments. We switch to this custom parser when interaction with search.

Instance Method Summary collapse

Constructor Details

#initialize(uri = nil, response = nil, body = nil, code = nil) ⇒ SearchPaginationParser

Returns a new instance of SearchPaginationParser.



7
8
9
10
# File 'lib/lonely_coder/search/search_pagination_parser.rb', line 7

def initialize(uri = nil, response = nil, body = nil, code =nil)
  body = JSON.parse(body)['html']
  super(uri, response, body, code)
end