Class: Pageflow::Admin::Tabs

Inherits:
Object
  • Object
show all
Defined in:
lib/pageflow/admin/tabs.rb

Instance Method Summary collapse

Constructor Details

#initializeTabs

Returns a new instance of Tabs


4
5
6
# File 'lib/pageflow/admin/tabs.rb', line 4

def initialize
  @tabs = {}
end

Instance Method Details

#find_by_resource(name) ⇒ Object


13
14
15
# File 'lib/pageflow/admin/tabs.rb', line 13

def find_by_resource(name)
  @tabs.fetch(name, [])
end

#register(resource_name, view_component) ⇒ Object


8
9
10
11
# File 'lib/pageflow/admin/tabs.rb', line 8

def register(resource_name, view_component)
  @tabs[resource_name] ||= []
  @tabs[resource_name] << view_component
end