Class: Eql::Config
- Inherits:
-
Object
- Object
- Eql::Config
- Defined in:
- lib/eql/config.rb
Overview
Config class holds rendering settings
Instance Attribute Summary collapse
-
#adapter ⇒ Symbol
Returns key of default adapter.
-
#cache_templates ⇒ Object
writeonly
Sets the attribute cache_templates.
-
#path ⇒ String
Returns templates root folder.
Instance Method Summary collapse
-
#cache_templates? ⇒ Boolean
Should templates be cached?.
-
#default_adapter ⇒ Eql::Adapters::Base
Returns default adapter.
-
#initialize ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize ⇒ Config
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
#adapter ⇒ 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
10 11 12 |
# File 'lib/eql/config.rb', line 10 def cache_templates=(value) @cache_templates = value end |
#path ⇒ 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?
22 23 24 |
# File 'lib/eql/config.rb', line 22 def cache_templates? @cache_templates end |
#default_adapter ⇒ Eql::Adapters::Base
Returns default adapter
36 37 38 39 |
# File 'lib/eql/config.rb', line 36 def default_adapter return unless adapter @default_adapter ||= AdapterFactory.adapters[adapter] end |