Class: Pageflow::Admin::Tabs
- Inherits:
-
Object
- Object
- Pageflow::Admin::Tabs
- Defined in:
- lib/pageflow/admin/tabs.rb
Instance Method Summary collapse
- #find_by_resource(resource) ⇒ Object private
-
#initialize ⇒ Tabs
constructor
private
A new instance of Tabs.
-
#register(resource_name, options) ⇒ Object
Display additional tabs on admin resource pages.
Constructor Details
#initialize ⇒ Tabs
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Tabs.
5 6 7 |
# File 'lib/pageflow/admin/tabs.rb', line 5 def initialize @tabs = {} end |
Instance Method Details
#find_by_resource(resource) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
33 34 35 36 37 |
# File 'lib/pageflow/admin/tabs.rb', line 33 def find_by_resource(resource) @tabs.fetch(resource_name(resource), []).map do || Tab.new(, resource) end end |
#register(resource_name, options) ⇒ Object
Display additional tabs on admin resource pages.
27 28 29 30 |
# File 'lib/pageflow/admin/tabs.rb', line 27 def register(resource_name, ) @tabs[resource_name] ||= [] @tabs[resource_name] << end |