Module: Mor

Defined in:
lib/mor.rb,
lib/mor/model.rb,
lib/mor/version.rb

Defined Under Namespace

Modules: Model

Constant Summary collapse

VERSION =
"0.0.4"
@@dalli =
{
  compress:     true,
  threadsafe:   true,
  servers:      ENV['MEMCACHIER_SERVERS'],
  password:     ENV['MEMCACHIER_PASSWORD'],
  username:     ENV['MEMCACHIER_USERNAME'],
  async:        true
}

Class Method Summary collapse

Class Method Details

.cacheObject



23
24
25
26
27
# File 'lib/mor.rb', line 23

def self.cache
  @@cache ||= begin
    ::Dalli::Client.new self.dalli["servers"].split(","), self.dalli.reject{|k,v| k == "servers"}
  end
end

.config {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:

  • _self (Mor)

    the object that the method was called on



19
20
21
# File 'lib/mor.rb', line 19

def self.config
  yield self
end

.dalliObject



15
16
17
# File 'lib/mor.rb', line 15

def self.dalli
  @@dalli
end