Module: Avo::Concerns::HasItemType
- 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/has_item_type.rb
Instance Method Summary collapse
- #is_field? ⇒ Boolean
- #is_heading? ⇒ Boolean
- #is_main_panel? ⇒ Boolean
- #is_panel? ⇒ Boolean
- #is_row? ⇒ Boolean
- #is_sidebar? ⇒ Boolean
- #is_tab? ⇒ Boolean
- #is_tab_group? ⇒ Boolean
- #is_tool? ⇒ Boolean
Instance Method Details
#is_field? ⇒ Boolean
5 6 7 |
# File 'lib/avo/concerns/has_item_type.rb', line 5 def is_field? self.class.ancestors.include?(Avo::Fields::BaseField) end |
#is_heading? ⇒ Boolean
9 10 11 |
# File 'lib/avo/concerns/has_item_type.rb', line 9 def is_heading? self.class.ancestors.include?(Avo::Fields::HeadingField) end |
#is_main_panel? ⇒ Boolean
17 18 19 |
# File 'lib/avo/concerns/has_item_type.rb', line 17 def is_main_panel? self.class.ancestors.include?(Avo::Resources::Items::MainPanel) end |
#is_panel? ⇒ Boolean
13 14 15 |
# File 'lib/avo/concerns/has_item_type.rb', line 13 def is_panel? self.class.ancestors.include?(Avo::Resources::Items::Panel) end |
#is_row? ⇒ Boolean
37 38 39 |
# File 'lib/avo/concerns/has_item_type.rb', line 37 def is_row? self.class.respond_to?(:item_type) && self.class.item_type == :row end |
#is_sidebar? ⇒ Boolean
33 34 35 |
# File 'lib/avo/concerns/has_item_type.rb', line 33 def self.class.ancestors.include?(Avo::Resources::Items::Sidebar) end |
#is_tab? ⇒ Boolean
25 26 27 |
# File 'lib/avo/concerns/has_item_type.rb', line 25 def is_tab? self.class.ancestors.include?(Avo::Resources::Items::Tab) end |
#is_tab_group? ⇒ Boolean
29 30 31 |
# File 'lib/avo/concerns/has_item_type.rb', line 29 def is_tab_group? self.class.ancestors.include?(Avo::Resources::Items::TabGroup) end |
#is_tool? ⇒ Boolean
21 22 23 |
# File 'lib/avo/concerns/has_item_type.rb', line 21 def is_tool? self.class.ancestors.include?(Avo::BaseResourceTool) end |