Class: WhosGotDirt::Responses::Helpers::OpenCorporatesHelper

Inherits:
WhosGotDirt::Response show all
Defined in:
lib/whos_got_dirt/responses/helpers/open_corporates.rb

Instance Method Summary collapse

Constructor Details

This class inherits a constructor from WhosGotDirt::Response

Instance Method Details

#countFixnum

Returns the total number of matching results.

Returns:

  • (Fixnum)

    the total number of matching results



15
16
17
# File 'lib/whos_got_dirt/responses/helpers/open_corporates.rb', line 15

def count
  parsed_body['total_count']
end

#pageFixnum

Returns the current page number.

Returns:

  • (Fixnum)

    the current page number



22
23
24
# File 'lib/whos_got_dirt/responses/helpers/open_corporates.rb', line 22

def page
  parsed_body['page']
end

#parse_bodyArray<Hash>

Parses the response body.

Returns:

  • (Array<Hash>)

    the parsed response body



8
9
10
# File 'lib/whos_got_dirt/responses/helpers/open_corporates.rb', line 8

def parse_body
  JSON.load(body)['results']
end