Sha256: ac7284643f0b900767853b9f519579432c3110add4e44066740e6b5c54fbd614

Contents?: true

Size: 208 Bytes

Versions: 4

Compression:

Stored size: 208 Bytes

Contents

module Mnemosyne
  module Helper
    def epoch(n, length)
      (Time.now.to_i / length) - n
    end

    def epoch_name(namespace, n, length)
      "mneme-#{namespace}-#{epoch(n, length)}"
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
mneme-0.6.0 lib/mneme/helper.rb
mneme-0.5.2 lib/mneme/helper.rb
mneme-0.5.1 lib/mneme/helper.rb
mneme-0.5.0 lib/mneme/helper.rb