Sha256: 464de317426b02e6b30981033d57766e147c14623b89be3be194759e4e766998

Contents?: true

Size: 543 Bytes

Versions: 7

Compression:

Stored size: 543 Bytes

Contents

require 'entrance/controller'
require 'entrance/model'
require 'entrance/ciphers'
require 'entrance/config'
require 'entrance/fields'
require 'digest/sha1'

module Entrance

  def self.config
    @config ||= Config.new
  end

  def self.model
    @model ||= Kernel.const_get(config.model)
  end

  def self.fields
    @fields ||= Fields.new
  end

  def self.configure
    yield config
    config.validate!
  end

  def self.generate_token(length = 40)
    str = Digest::SHA1.hexdigest([Time.now, rand].join)
    str[0..(length-1)]
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
entrance-0.4.6 lib/entrance.rb
entrance-0.4.5 lib/entrance.rb
entrance-0.4.4 lib/entrance.rb
entrance-0.4.3 lib/entrance.rb
entrance-0.4.2 lib/entrance.rb
entrance-0.4.1 lib/entrance.rb
entrance-0.4.0 lib/entrance.rb