Class: EasyAdmin::DashboardRegistry

Inherits:
Object
  • Object
show all
Defined in:
lib/easy_admin/dashboard_registry.rb

Class Method Summary collapse

Class Method Details

.allObject



17
18
19
# File 'lib/easy_admin/dashboard_registry.rb', line 17

def all
  dashboards.values
end

.clear!Object



25
26
27
# File 'lib/easy_admin/dashboard_registry.rb', line 25

def clear!
  @dashboards = {}
end

.dashboardsObject



4
5
6
# File 'lib/easy_admin/dashboard_registry.rb', line 4

def dashboards
  @dashboards ||= {}
end

.exists?(route_key) ⇒ Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/easy_admin/dashboard_registry.rb', line 21

def exists?(route_key)
  dashboards.key?(route_key.to_s)
end

.find(route_key) ⇒ Object



13
14
15
# File 'lib/easy_admin/dashboard_registry.rb', line 13

def find(route_key)
  dashboards[route_key.to_s]
end

.register(dashboard_class) ⇒ Object



8
9
10
11
# File 'lib/easy_admin/dashboard_registry.rb', line 8

def register(dashboard_class)
  route_key = dashboard_class.route_key
  dashboards[route_key] = dashboard_class
end