Class: Eql::Config

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

Overview

Config class holds rendering settings

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



12
13
14
15
# File 'lib/eql/config.rb', line 12

def initialize
  @adapter         = :active_record
  @cache_templates = true
end

Instance Attribute Details

#adapterSymbol

Returns key of default adapter

Returns:

  • (Symbol)

    returns key of default adapter



9
10
11
# File 'lib/eql/config.rb', line 9

def adapter
  @adapter
end

#cache_templates=(value) ⇒ Object (writeonly)

Sets the attribute cache_templates

Parameters:

  • value

    the value to set the attribute cache_templates to.



10
11
12
# File 'lib/eql/config.rb', line 10

def cache_templates=(value)
  @cache_templates = value
end

#pathString

Returns templates root folder

Returns:

  • (String)

    returns templates root folder



7
8
9
# File 'lib/eql/config.rb', line 7

def path
  @path
end

Instance Method Details

#cache_templates?Boolean

Should templates be cached?

Returns:

  • (Boolean)


22
23
24
# File 'lib/eql/config.rb', line 22

def cache_templates?
  @cache_templates
end

#default_adapterEql::Adapters::Base

Returns default adapter

Returns:



36
37
38
39
# File 'lib/eql/config.rb', line 36

def default_adapter
  return unless adapter
  @default_adapter ||= AdapterFactory.adapters[adapter]
end