Sha256: c95149f91b564e3e558aaa5287b1256dea6d3a7faf0a46c9a880bef1b6e7d671

Contents?: true

Size: 400 Bytes

Versions: 2

Compression:

Stored size: 400 Bytes

Contents

require_relative 'tracker'

module Sojourn
  module Controller
    def self.included(base)
      base.before_filter :track_sojourning
      base.before_filter :save_sojourn_session
    end

    def sojourn
      @sojourn ||= Tracker.new(self)
    end

  private

    def track_sojourning
      sojourn.sojourning!
    end

    def save_sojourn_session
      sojourn.update_session!
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sojourn-0.1.1 lib/sojourn/controller.rb
sojourn-0.1.0 lib/sojourn/controller.rb