Sha256: 9765559bde66778afdaa0500ed0a5d5db3c29ced59bf5798def5c45869c1db4e

Contents?: true

Size: 600 Bytes

Versions: 4

Compression:

Stored size: 600 Bytes

Contents

module Wayback
  module API
    module Utils

    private

      # @param klass [Class]
      # @param request_method [Symbol]
      # @param path [String]
      # @param options [Hash]
      # @return [Object]
      def object_from_response(klass, request_method, path, options={})
        response = send(request_method.to_sym, path, options)
        klass.from_response(response)
      end

      # def handle_forbidden_error(klass, error)
      #   if error.message == klass::MESSAGE
      #     raise klass.new
      #   else
      #     raise error
      #   end
      # end

    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
wayback-0.3.1 lib/wayback/api/utils.rb
wayback-0.2.1 lib/wayback/api/utils.rb
wayback-0.2.0 lib/wayback/api/utils.rb
wayback-0.1.0 lib/wayback/api/utils.rb