Class: Pageflow::Admin::Tabs
- Inherits:
-
Object
- Object
- Pageflow::Admin::Tabs
- Defined in:
- lib/pageflow/admin/tabs.rb
Instance Method Summary collapse
- #find_by_resource(name) ⇒ Object private
-
#initialize ⇒ Tabs
constructor
A new instance of Tabs.
- #register(resource_name, tab_options) ⇒ Object
Constructor Details
#initialize ⇒ Tabs
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
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.
16 17 18 |
# File 'lib/pageflow/admin/tabs.rb', line 16 def find_by_resource(name) @tabs.fetch(name, []) end |
#register(resource_name, tab_options) ⇒ Object
10 11 12 13 |
# File 'lib/pageflow/admin/tabs.rb', line 10 def register(resource_name, ) @tabs[resource_name] ||= [] @tabs[resource_name] << end |