Module: Stache::Config
- Included in:
- Stache
- Defined in:
- lib/stache/config.rb
Overview
Change these defaults in, say, an initializer.
Stache.template_base_path = Rails.root.join(‘app’, ‘templates’)
Or with the block syntax:
Stache.configure do |config|
config.template_base_path = Rails.root.join('app', 'views', 'shared')
use :mustache # or :handlebars
end
Instance Attribute Summary collapse
-
#include_path_in_id ⇒ Object
Returns the value of attribute include_path_in_id.
-
#shared_path ⇒ Object
Returns the value of attribute shared_path.
-
#template_base_class ⇒ Object
Returns the value of attribute template_base_class.
-
#template_base_path ⇒ Object
Returns the value of attribute template_base_path.
-
#template_cache ⇒ Object
Returns the value of attribute template_cache.
-
#template_extension ⇒ Object
Returns the value of attribute template_extension.
-
#wrapper_module_name ⇒ Object
Returns the value of attribute wrapper_module_name.
Instance Method Summary collapse
Instance Attribute Details
#include_path_in_id ⇒ Object
Returns the value of attribute include_path_in_id.
14 15 16 |
# File 'lib/stache/config.rb', line 14 def include_path_in_id @include_path_in_id end |
#shared_path ⇒ Object
Returns the value of attribute shared_path.
14 15 16 |
# File 'lib/stache/config.rb', line 14 def shared_path @shared_path end |
#template_base_class ⇒ Object
Returns the value of attribute template_base_class.
14 15 16 |
# File 'lib/stache/config.rb', line 14 def template_base_class @template_base_class end |
#template_base_path ⇒ Object
Returns the value of attribute template_base_path.
14 15 16 |
# File 'lib/stache/config.rb', line 14 def template_base_path @template_base_path end |
#template_cache ⇒ Object
Returns the value of attribute template_cache.
14 15 16 |
# File 'lib/stache/config.rb', line 14 def template_cache @template_cache end |
#template_extension ⇒ Object
Returns the value of attribute template_extension.
14 15 16 |
# File 'lib/stache/config.rb', line 14 def template_extension @template_extension end |
#wrapper_module_name ⇒ Object
Returns the value of attribute wrapper_module_name.
14 15 16 |
# File 'lib/stache/config.rb', line 14 def wrapper_module_name @wrapper_module_name end |
Instance Method Details
#configure {|_self| ... } ⇒ Object
16 17 18 |
# File 'lib/stache/config.rb', line 16 def configure yield self end |
#use(template_engine) ⇒ Object
68 69 70 |
# File 'lib/stache/config.rb', line 68 def use template_engine require "stache/#{template_engine}" end |