Module: Moneta::Middleware

Included in:
Builder
Defined in:
lib/moneta/builder.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(klass) ⇒ Object



3
4
5
6
7
# File 'lib/moneta/builder.rb', line 3

def self.included(klass)
  class << klass
    alias build new
  end
end

Instance Method Details

#[](key) ⇒ Object



13
14
15
# File 'lib/moneta/builder.rb', line 13

def [](key)
  @adapter[key]
end

#[]=(key, value) ⇒ Object



17
18
19
# File 'lib/moneta/builder.rb', line 17

def []=(key, value)
  @adapter[key] = value
end

#build(adapter) ⇒ Object



9
10
11
# File 'lib/moneta/builder.rb', line 9

def build(adapter)
  @adapter = adapter
end

#clear(*args) ⇒ Object



41
42
43
# File 'lib/moneta/builder.rb', line 41

def clear(*args)
  @adapter.clear(*args)
end

#closeObject



45
46
47
# File 'lib/moneta/builder.rb', line 45

def close
  @adapter.close
end

#delete(key, *args) ⇒ Object



25
26
27
# File 'lib/moneta/builder.rb', line 25

def delete(key, *args)
  @adapter.delete(key, *args)
end

#fetch(*args, &block) ⇒ Object



21
22
23
# File 'lib/moneta/builder.rb', line 21

def fetch(*args, &block)
  @adapter.fetch(*args, &block)
end

#key?(key, *args) ⇒ Boolean

Returns:

  • (Boolean)


37
38
39
# File 'lib/moneta/builder.rb', line 37

def key?(key, *args)
  @adapter.key?(key, *args)
end

#store(key, value, *args) ⇒ Object



29
30
31
# File 'lib/moneta/builder.rb', line 29

def store(key, value, *args)
  @adapter.store(key, value, *args)
end

#update_key(key, options) ⇒ Object



33
34
35
# File 'lib/moneta/builder.rb', line 33

def update_key(key, options)
  @adapter.update_key(key, options)
end