Class: Flexite::Configuration

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



7
8
9
10
11
12
13
14
15
# File 'lib/flexite/configuration.rb', line 7

def initialize
  @paths = {}
  @root_cache_key = 'all-cached-nodes'
  @cache = ActiveSupport::Cache::MemoryStore.new(size: 64.megabytes)
  @app_link = '/'
  @source_roots = {}
  @hierarchy = {}
  @history_limit = 10
end

Instance Attribute Details

Returns the value of attribute app_link.



4
5
6
# File 'lib/flexite/configuration.rb', line 4

def app_link
  @app_link
end

#app_nameObject

Returns the value of attribute app_name.



4
5
6
# File 'lib/flexite/configuration.rb', line 4

def app_name
  @app_name
end

#cacheObject (readonly)

Returns the value of attribute cache.



5
6
7
# File 'lib/flexite/configuration.rb', line 5

def cache
  @cache
end

#hierarchyObject

Returns the value of attribute hierarchy.



3
4
5
# File 'lib/flexite/configuration.rb', line 3

def hierarchy
  @hierarchy
end

#history_limitObject

Returns the value of attribute history_limit.



4
5
6
# File 'lib/flexite/configuration.rb', line 4

def history_limit
  @history_limit
end

#pathsObject

Returns the value of attribute paths.



3
4
5
# File 'lib/flexite/configuration.rb', line 3

def paths
  @paths
end

#root_cache_keyObject

Returns the value of attribute root_cache_key.



3
4
5
# File 'lib/flexite/configuration.rb', line 3

def root_cache_key
  @root_cache_key
end

#source_rootsObject

Returns the value of attribute source_roots.



3
4
5
# File 'lib/flexite/configuration.rb', line 3

def source_roots
  @source_roots
end

Instance Method Details

#cache_store=(*args) ⇒ Object



17
18
19
20
21
22
23
# File 'lib/flexite/configuration.rb', line 17

def cache_store=(*args)
  @cache = ActiveSupport::Cache.lookup_store(*args)

  if @cache.options[:namespace].blank?
    @cache.options[:namespace] = :flexite
  end
end