Class: Packr::Rails::Template

Inherits:
Tilt::Template
  • Object
show all
Defined in:
lib/packr/rails/template.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.engine_initialized?Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/packr/rails/template.rb', line 8

def self.engine_initialized?
  defined?(::Packr)
end

Instance Method Details

#evaluate(scope, locals, &block) ⇒ Object



23
24
25
# File 'lib/packr/rails/template.rb', line 23

def evaluate(scope, locals, &block)
  Packr.pack(data, packr_options(scope))
end

#initialize_engineObject



12
13
14
# File 'lib/packr/rails/template.rb', line 12

def initialize_engine
  require_template_library 'packr'
end

#packr_options(scope) ⇒ Object



27
28
29
# File 'lib/packr/rails/template.rb', line 27

def packr_options(scope)
  packr_options_from_rails(scope)
end

#packr_options_from_rails(scope) ⇒ Object



31
32
33
# File 'lib/packr/rails/template.rb', line 31

def packr_options_from_rails(scope)
  scope.environment.context_class.packr_config
end

#prepareObject



20
21
# File 'lib/packr/rails/template.rb', line 20

def prepare
end

#syntaxObject



16
17
18
# File 'lib/packr/rails/template.rb', line 16

def syntax
  :packr
end