Sha256: 50ed6c3cafb0bbe9021293797796c0f395b22beea6dde976904aa70a6dea8626

Contents?: true

Size: 441 Bytes

Versions: 4

Compression:

Stored size: 441 Bytes

Contents

require 'glengarry/application_controller'

module Glengarry
  class ApplicationController < ActionController::Base
    cattr_accessor :authenticator

    # This is a useful pattern I found in the Tolk source: https://github.com/tolk/tolk/blob/master/app/controllers/tolk/application_controller.rb
    def authenticate
      self.authenticator.bind(self).call if self.authenticator && self.authenticator.respond_to?(:call)
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
glengarry-0.0.4 app/controllers/glengarry/application_controller.rb
glengarry-0.0.3 app/controllers/glengarry/application_controller.rb
glengarry-0.0.2 app/controllers/glengarry/application_controller.rb
glengarry-0.0.1 app/controllers/glengarry/application_controller.rb