Class: DisplayCase::Configuration
- Inherits:
-
Object
- Object
- DisplayCase::Configuration
- Defined in:
- lib/display_case/configuration.rb
Instance Attribute Summary collapse
-
#cache_store ⇒ Object
A cache store which responds to ‘fetch(key, options, &block)`.
-
#definition_file_paths ⇒ Object
An Array of strings specifying locations that should be searched for exhibit classes and definitions.
-
#explicit ⇒ Object
A boolean indicating whether the Exhibits will be explicitly listed in order or dynamically collected with the inherited callback.
-
#logging_enabled ⇒ Object
A boolean indicating whether or not to log to the Rails logger.
-
#smart_matching ⇒ Object
A boolean indicating whether Exhibits with names that are similar to context should be favored over other exhibits.
Instance Method Summary collapse
- #exhibits ⇒ Object
- #exhibits=(val) ⇒ Object
- #explicit? ⇒ Boolean
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #logging_enabled? ⇒ Boolean
- #smart_matching? ⇒ Boolean
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
34 35 36 37 38 39 40 41 |
# File 'lib/display_case/configuration.rb', line 34 def initialize @definition_file_paths = %w(app/exhibits) @explicit = false @exhibits = [] @cache_store = nil @logging_enabled = false @smart_matching = true end |
Instance Attribute Details
#cache_store ⇒ Object
A cache store which responds to ‘fetch(key, options, &block)`
25 26 27 |
# File 'lib/display_case/configuration.rb', line 25 def cache_store @cache_store end |
#definition_file_paths ⇒ Object
An Array of strings specifying locations that should be searched for exhibit classes and definitions. By default, “/app/exhibits” will be searched and existing file will be loaded.
22 23 24 |
# File 'lib/display_case/configuration.rb', line 22 def definition_file_paths @definition_file_paths end |
#explicit ⇒ Object
A boolean indicating whether the Exhibits will be explicitly listed in order or dynamically collected with the inherited callback. By default, this is false and the list will be generated via the inherited callback.
17 18 19 |
# File 'lib/display_case/configuration.rb', line 17 def explicit @explicit end |
#logging_enabled ⇒ Object
A boolean indicating whether or not to log to the Rails logger
28 29 30 |
# File 'lib/display_case/configuration.rb', line 28 def logging_enabled @logging_enabled end |
#smart_matching ⇒ Object
A boolean indicating whether Exhibits with names that are similar to context should be favored over other exhibits. By default, this is true
32 33 34 |
# File 'lib/display_case/configuration.rb', line 32 def smart_matching @smart_matching end |
Instance Method Details
#exhibits ⇒ Object
55 56 57 |
# File 'lib/display_case/configuration.rb', line 55 def exhibits [DisplayCase::Exhibit::Exhibited,DisplayCase::BasicExhibit,DisplayCase::EnumerableExhibit] + @exhibits end |
#exhibits=(val) ⇒ Object
59 60 61 |
# File 'lib/display_case/configuration.rb', line 59 def exhibits=(val) @exhibits = Array(val) end |
#explicit? ⇒ Boolean
43 44 45 |
# File 'lib/display_case/configuration.rb', line 43 def explicit? explicit end |
#logging_enabled? ⇒ Boolean
51 52 53 |
# File 'lib/display_case/configuration.rb', line 51 def logging_enabled? defined? ::Rails and logging_enabled end |
#smart_matching? ⇒ Boolean
47 48 49 |
# File 'lib/display_case/configuration.rb', line 47 def smart_matching? smart_matching end |