Module: Avo::Concerns::IsResourceItem
- Includes:
- Hydration
- Included in:
- BaseResourceTool, Fields::BaseField, Resources::Items::ItemGroup, Resources::Items::Row, Resources::Items::Sidebar, Resources::Items::Tab, Resources::Items::TabGroup
- Defined in:
- lib/avo/concerns/is_resource_item.rb
Instance Attribute Summary collapse
-
#resource ⇒ Object
These attributes are required to be hydrated in order to properly find the visible_items.
-
#view ⇒ Object
Returns the value of attribute view.
Instance Method Summary collapse
-
#visible? ⇒ Boolean
Returns the final state of if an item is visible or not For items that have children it checks to see if it contains any visible children.
Methods included from Hydration
Instance Attribute Details
#resource ⇒ Object
These attributes are required to be hydrated in order to properly find the visible_items
8 9 10 |
# File 'lib/avo/concerns/is_resource_item.rb', line 8 def resource @resource end |
#view ⇒ Object
Returns the value of attribute view.
9 10 11 |
# File 'lib/avo/concerns/is_resource_item.rb', line 9 def view @view end |
Instance Method Details
#visible? ⇒ Boolean
Returns the final state of if an item is visible or not For items that have children it checks to see if it contains any visible children.
13 14 15 16 17 18 19 20 21 |
# File 'lib/avo/concerns/is_resource_item.rb', line 13 def visible? # For items that may contains other items like tabs and panels we should also check # if any on their children have visible items. if self.class.ancestors.include?(Avo::Concerns::HasItems) return false unless visible_items.any? end super end |