Class: Appboard::DashboardSetup

Inherits:
Object
  • Object
show all
Defined in:
lib/appboard/dashboardsetup.rb

Overview

Dashboard configuration

Defined Under Namespace

Classes: Dashboard, Widget

Instance Method Summary collapse

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('widget 1') {
  type "..."
  size "..."  		
}

widget('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_dashboardObject



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 get_widget(name)
  @dashboard.widget(name)
end

#has_widget(name) ⇒ Object



164
165
166
# File 'lib/appboard/dashboardsetup.rb', line 164

def has_widget(name)
  @dashboard.has(name)
end