Sha256: beed06e03b7f1fd4fd9211111860497284f1ce1190771bcebf116b714c843ece

Contents?: true

Size: 635 Bytes

Versions: 6

Compression:

Stored size: 635 Bytes

Contents

require 'nyauth/session_serializer'

module Nyauth
  class Nyan
    def initialize(env)
      @env = env
    end

    def session
      @serializer ||= Nyauth::SessionSerializer.new(@env)
    end

    def self.run_callback(nyan, &block)
      %w(on_test_request).each do |kind|
        __send__("_#{kind}").each do |callback, options|
          callback.call(nyan, *options)
        end
      end

      @@_on_test_request = []
      yield
    end

    def self.on_test_request(options = {}, &block)
      _on_test_request.push([block, options])
    end

    def self._on_test_request
      @@_on_test_request ||= []
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
nyauth-0.7.2 lib/nyauth/nyan.rb
nyauth-0.7.1 lib/nyauth/nyan.rb
nyauth-0.7.0 lib/nyauth/nyan.rb
nyauth-0.6.2 lib/nyauth/nyan.rb
nyauth-0.6.1 lib/nyauth/nyan.rb
nyauth-0.6.0 lib/nyauth/nyan.rb