Class: Babl::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/babl.rb

Overview

There is basically two ways to use BABL: the Rails way, and the clean way.

Rails way

  • BABL detects Rails and integrates with it automatically (only if BABL is required AFTER Rails).

  • BABL configuration is global (defined via Babl.configure).

  • Global configuration is also used by:

    Babl.template
    Babl.compile
    Babl.source
    

Clean way

  • You can decide not to use global configuration. It will result in more verbosity but it protects you from global settings.

  • Equivalences:

    Babl.template  ==> Babl::Template.new
    Babl.compile   ==> Babl::Template#compile
    Babl.source    ==> Babl::Template#source
    

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



34
35
36
37
38
39
40
# File 'lib/babl.rb', line 34

def initialize
    @preloader = Rendering::NoopPreloader
    @pretty = true
    @cache_templates = false
    @lookup_context = nil
    @using = []
end

Instance Attribute Details

#cache_templatesObject

No practical use outside Bannerman today.



28
29
30
# File 'lib/babl.rb', line 28

def cache_templates
  @cache_templates
end

#lookup_contextObject

No practical use outside Bannerman today.



28
29
30
# File 'lib/babl.rb', line 28

def lookup_context
  @lookup_context
end

#preloaderObject

No practical use outside Bannerman today.



28
29
30
# File 'lib/babl.rb', line 28

def preloader
  @preloader
end

#prettyObject

No practical use outside Bannerman today.



28
29
30
# File 'lib/babl.rb', line 28

def pretty
  @pretty
end

#usingObject

No practical use outside Bannerman today.



28
29
30
# File 'lib/babl.rb', line 28

def using
  @using
end