Class: Dashboards::Configuration

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

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_durationObject

, :per_page



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

def cache_duration
  @cache_duration
end

#chart_libraryObject

, :per_page



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

def chart_library
  @chart_library
end

#dashboardsObject (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