Class: Dashboards::Configuration
- Inherits:
-
Object
- Object
- Dashboards::Configuration
- Defined in:
- lib/dashboards/configuration.rb
Instance Attribute Summary collapse
-
#cache_duration ⇒ Object
, :per_page.
-
#chart_library ⇒ Object
, :per_page.
-
#dashboards ⇒ Object
readonly
Returns the value of attribute dashboards.
Instance Method Summary collapse
- #add_dashboard(dashboard) ⇒ Object
- #find_dashboard(slug) ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
6 7 8 9 10 11 |
# File 'lib/dashboards/configuration.rb', line 6 def initialize @dashboards = [] @chart_library = :chartkick # Default to chartkick @cache_duration = 5.minutes # @per_page = 20 end |
Instance Attribute Details
#cache_duration ⇒ Object
, :per_page
4 5 6 |
# File 'lib/dashboards/configuration.rb', line 4 def cache_duration @cache_duration end |
#chart_library ⇒ Object
, :per_page
4 5 6 |
# File 'lib/dashboards/configuration.rb', line 4 def chart_library @chart_library end |
#dashboards ⇒ Object (readonly)
Returns the value of attribute dashboards.
3 4 5 |
# File 'lib/dashboards/configuration.rb', line 3 def dashboards @dashboards end |
Instance Method Details
#add_dashboard(dashboard) ⇒ Object
13 14 15 |
# File 'lib/dashboards/configuration.rb', line 13 def add_dashboard(dashboard) @dashboards << dashboard end |
#find_dashboard(slug) ⇒ Object
17 18 19 |
# File 'lib/dashboards/configuration.rb', line 17 def find_dashboard(slug) @dashboards.find { |d| d.slug == slug } end |