Class/Module Index [+]

Quicksearch

Github::Validations::Token

Public Instance Methods

validates_token_for(method, path) click to toggle source

Ensures that required authentication token is present before request is sent.

# File lib/github_api/validations/token.rb, line 26
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

[Validate]

Generated with the Darkfish Rdoc Generator 2.