Sha256: 1aa7d415e68944e71eb6f56fc98444dd533daa079e5c85d83f86c8e6a3f01863
Contents?: true
Size: 461 Bytes
Versions: 6
Compression:
Stored size: 461 Bytes
Contents
# frozen_string_literal: true module Smartling module Verbs %i[get put post patch delete].each do |verb| define_method(verb) do |path, options = {}| authenticate do |token| (options[:headers] ||= {})[:Authorization] = "Bearer #{token}" resp = self.class.send(verb, path, options).parsed_response return resp unless resp.is_a?(Hash) HipsterHash[resp].response end end end end end
Version data entries
6 entries across 6 versions & 1 rubygems