Sha256: 7bcd72e6b7758316b657907d6f13b2065382f53f8216e16e46b6b26681cf44af
Contents?: true
Size: 800 Bytes
Versions: 20
Compression:
Stored size: 800 Bytes
Contents
# encoding: utf-8 module Nimbu module Request module Validations module Token TOKEN_REQUIRED = [ 'get /sites', 'get /channels' ] TOKEN_REQUIRED_REGEXP = [ /channels\/.*\/.*\/entries/, ] # Ensures that required authentication token is present before # request is sent. # def validates_token_for(method, path) return true unless TOKEN_REQUIRED.grep("#{method} #{path}").empty? token_required = false TOKEN_REQUIRED_REGEXP.each do |regex| if "#{method} #{path}" =~ regex token_required = true end end return token_required end end # Token end # Validations end # Request end # Nimbu
Version data entries
20 entries across 20 versions & 1 rubygems