Sha256: 192a999b3a224198038fa47b012c015a91f9197343984b0ed7ed1b77ea35a681

Contents?: true

Size: 634 Bytes

Versions: 6

Compression:

Stored size: 634 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.5.0 lib/nyauth/nyan.rb
nyauth-0.4.0 lib/nyauth/nyan.rb
nyauth-0.3.0 lib/nyauth/nyan.rb
nyauth-0.2.8 lib/nyauth/nyan.rb
nyauth-0.2.7 lib/nyauth/nyan.rb
nyauth-0.2.6 lib/nyauth/nyan.rb