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
sinatra-footnotes-0.1.5 lib/sinatra-footnotes/notes/session_note.rb
sinatra-footnotes-0.1.4 lib/sinatra-footnotes/notes/session_note.rb
sinatra-footnotes-0.1.3 lib/sinatra-footnotes/notes/session_note.rb
sinatra-footnotes-0.1.2 lib/sinatra-footnotes/notes/session_note.rb
sinatra-footnotes-0.1.1 lib/sinatra-footnotes/notes/session_note.rb
sinatra-footnotes-0.1 lib/sinatra-footnotes/notes/session_note.rb
rails-footnotes-3.7.2 lib/rails-footnotes/notes/session_note.rb
rails-footnotes-3.7.1 lib/rails-footnotes/notes/session_note.rb
rails-footnotes-3.7.1.pre lib/rails-footnotes/notes/session_note.rb
rails3-footnotes-4.0.0.pre.10 lib/rails-footnotes/notes/session_note.rb
rails3-footnotes-4.0.0.pre.9 lib/rails-footnotes/notes/session_note.rb
rails3-footnotes-4.0.0.pre.8 lib/rails-footnotes/notes/session_note.rb
rails3-footnotes-4.0.0.pre.7 lib/rails-footnotes/notes/session_note.rb
rails3-footnotes-4.0.0.pre.6 lib/rails-footnotes/notes/session_note.rb
rails3-footnotes-4.0.0.pre.5 lib/rails-footnotes/notes/session_note.rb
rails3-footnotes-4.0.0.pre.4 lib/rails-footnotes/notes/session_note.rb
rails3-footnotes-4.0.0.pre.3 lib/rails-footnotes/notes/session_note.rb
rails-footnotes-3.7.0 lib/rails-footnotes/notes/session_note.rb
rails3-footnotes-4.0.0.pre.2 lib/rails-footnotes/notes/session_note.rb
rails3-footnotes-4.0.0.pre.1 lib/rails-footnotes/notes/session_note.rb