Sha256: 026fa553491779970fbd72162cfcc9d86fe0a78774b51465e495907be438bcfd

Contents?: true

Size: 666 Bytes

Versions: 4

Compression:

Stored size: 666 Bytes

Contents

module WhosGotDirt
  module Responses
    module Helpers
      class OpenCorporatesHelper < Response
        # Parses the response body.
        #
        # @return [Array<Hash>] the parsed response body
        def parse_body
          JSON.load(body)['results']
        end

        # Returns the total number of matching results.
        #
        # @return [Fixnum] the total number of matching results
        def count
          parsed_body['total_count']
        end

        # Returns the current page number.
        #
        # @return [Fixnum] the current page number
        def page
          parsed_body['page']
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
whos_got_dirt-0.0.5 lib/whos_got_dirt/responses/helpers/open_corporates.rb
whos_got_dirt-0.0.4 lib/whos_got_dirt/responses/helpers/open_corporates.rb
whos_got_dirt-0.0.3 lib/whos_got_dirt/responses/helpers/open_corporates.rb
whos_got_dirt-0.0.2 lib/whos_got_dirt/responses/helpers/open_corporates.rb