Class: Appboard::DashboardSetup
- Inherits:
-
Object
- Object
- Appboard::DashboardSetup
- Defined in:
- lib/appboard/dashboardsetup.rb
Overview
Dashboard configuration
Defined Under Namespace
Instance Method Summary collapse
-
#apiKey(value = nil) ⇒ Object
Define API key.
-
#dashboard(name) ⇒ Object
Define a dashboard.
- #get_dashboard ⇒ Object
- #get_widget(name) ⇒ Object
- #has_widget(name) ⇒ Object
Instance Method Details
#apiKey(value = nil) ⇒ Object
Define API key
129 130 131 132 |
# File 'lib/appboard/dashboardsetup.rb', line 129 def apiKey(value = nil) @apiKey = value unless value.nil? @apiKey end |
#dashboard(name) ⇒ Object
Define a dashboard. May be called inside setup loop or separately
dashboard(‘name’) {
width 5
('widget 1') {
type "..."
size "..."
}
('widget 2') {
# widget configuration is here
}
}
149 150 151 152 153 154 |
# File 'lib/appboard/dashboardsetup.rb', line 149 def dashboard(name) block = Proc.new @dashboard = Dashboard.new(name, &block) self end |
#get_dashboard ⇒ Object
156 157 158 |
# File 'lib/appboard/dashboardsetup.rb', line 156 def get_dashboard @dashboard end |
#get_widget(name) ⇒ Object
160 161 162 |
# File 'lib/appboard/dashboardsetup.rb', line 160 def (name) @dashboard.(name) end |
#has_widget(name) ⇒ Object
164 165 166 |
# File 'lib/appboard/dashboardsetup.rb', line 164 def (name) @dashboard.has(name) end |