Sha256: 394f2d526fcfb5fc52d6f96a7b19c6b38ca799a348b9dfdbe49bf7045e494568

Contents?: true

Size: 675 Bytes

Versions: 23

Compression:

Stored size: 675 Bytes

Contents

require "#{File.dirname(__FILE__)}/abstract_note"

module Footnotes
  module Notes
    class SessionNote < AbstractNote
      def initialize(controller)
        session = controller.session
        if session
          if session.respond_to? :to_hash
            # rails >= 2.3
            session = session.to_hash
          else
            #rails < 2.3
            session = session.data
          end
        end
        @session = (session || {}).symbolize_keys
      end

      def title
        "Session (#{@session.length})"
      end

      def content
        mount_table_for_hash(@session, :summary => "Debug information for #{title}")
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 3 rubygems

Version Path
rails3-footnotes-4.0.0.pre lib/rails-footnotes/notes/session_note.rb
rails-footnotes-3.6.7 lib/rails-footnotes/notes/session_note.rb
rails-footnotes-3.6.6 lib/rails-footnotes/notes/session_note.rb