Class: PacerApi::Immediate::CaseSearch

Inherits:
Object
  • Object
show all
Defined in:
lib/pacer_api/immediate/case_search.rb

Defined Under Namespace

Classes: Page

Constant Summary collapse

PATH =
"cases/find?page=%d"

Instance Method Summary collapse

Constructor Details

#initialize(session, params) ⇒ CaseSearch

Returns a new instance of CaseSearch.



11
12
13
14
# File 'lib/pacer_api/immediate/case_search.rb', line 11

def initialize(session, params)
  @session = session
  @params = params
end

Instance Method Details

#fetch(page = 0) ⇒ Object



16
17
18
19
20
# File 'lib/pacer_api/immediate/case_search.rb', line 16

def fetch(page = 0)
  path = format(PATH, page)
  payload = @session.post(path, @params)
  Page.new(payload)
end