Class: Tzispa::Rig::Engine

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/tzispa/rig/engine.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeEngine

Returns a new instance of Engine.



13
14
15
16
# File 'lib/tzispa/rig/engine.rb', line 13

def initialize
  @cache = Moneta.new(:LRUHash, threadsafe: true)
  # @cache = LruRedux::TTL::ThreadSafeCache.new(Engine.cache_size, Engine.cache_ttl)
end

Class Method Details

.block(name:, domain:, content_type:, params: nil) ⇒ Object



27
28
29
# File 'lib/tzispa/rig/engine.rb', line 27

def block(name:, domain:, content_type:, params: nil)
  rig_template name, domain, :block, content_type, params
end

.emptyObject



19
20
21
# File 'lib/tzispa/rig/engine.rb', line 19

def empty
  TemplateBase.new
end

.layout(name:, domain:, content_type:, params: nil) ⇒ Object



23
24
25
# File 'lib/tzispa/rig/engine.rb', line 23

def layout(name:, domain:, content_type:, params: nil)
  rig_template name, domain, :layout, content_type, params
end

.rig_template(name, domain, block_type, content_type, params) ⇒ Object



35
36
37
# File 'lib/tzispa/rig/engine.rb', line 35

def rig_template(name, domain, block_type, content_type, params)
  instance.send(:cache_template, name, domain, block_type, content_type, params)
end

.static(name:, domain:, content_type:, params: nil) ⇒ Object



31
32
33
# File 'lib/tzispa/rig/engine.rb', line 31

def static(name:, domain:, content_type:, params: nil)
  rig_template name, domain, :static, content_type, params
end