<commit_before>require "dm-core"
require "dm-timestamps"

##
# This is a database backed session handle for DataMapper. You can use it
# instead of the builtin Harbor::Session::Cookie by doing:
# 
# Harbor::Session.configure do |session|
#   session.store = Harbor::Contrib::Session::DataMapper
# end
# 
# A basic Session resource is defined for you.
##
module Harbor
  module Contrib
    class Session
      class DataMapper < Harbor::Session::Abstract

        class SessionHash < Hash
          def initialize(instance)
            super()
            @instance = instance
            merge!(@instance.data)
          end

          def [](key)
            key == :session_id ? @instance.id : super
          end

          def []=(key, value)<commit_msg>Moving Harbor::Contrib::Session::DataMapper docs to correct location.<commit_after>require "dm-core"
require "dm-timestamps"

module Harbor
  module Contrib
    class Session
      ##
      # This is a database backed session handle for DataMapper. You can use it
      # instead of the builtin Harbor::Session::Cookie by doing:
      # 
      # Harbor::Session.configure do |session|
      #   session.store = Harbor::Contrib::Session::DataMapper
      # end
      # 
      # A basic Session resource is defined for you.
      ##
      class DataMapper < Harbor::Session::Abstract

        class SessionHash < Hash
          def initialize(instance)
            super()
            @instance = instance
            merge!(@instance.data)
          end

          def [](key)
            key == :session_id ? @instance.id : super
          end

          def []=(key, value)
{'fraction_non_alphanumeric': 0.09620098039215687, 'fraction_numerical': 0.0, 'mean_word_length': 2.259481037924152, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2388861', 'n_tokens_mistral': 432, 'n_tokens_neox': 420, 'n_words': 138}