Sha256: 83c07ba275de5663af43fe448c366681586e47a49dceeed0f5328ba37d9e3682

Contents?: true

Size: 396 Bytes

Versions: 2

Compression:

Stored size: 396 Bytes

Contents

require 'active_support/core_ext'
require 'multi_json'

module HackernewsRuby
  module Request

    def get(path, options)
      request(:get, path, options)
    end

    def request(method, path, options)
      response = connection.send(method) do |request|
        case method
        when :get
          request.url(path, options)
        end
      end

      response.body
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
hackernews_ruby-0.0.3 lib/hackernews_ruby/request.rb
hackernews_ruby-0.0.2 lib/hackernews_ruby/request.rb