Module: Avo::Concerns::HasItemType

Instance Method Summary collapse

Instance Method Details

#is_field?Boolean

Returns:

  • (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

Returns:

  • (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

Returns:

  • (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

Returns:

  • (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

Returns:

  • (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

Returns:

  • (Boolean)


33
34
35
# File 'lib/avo/concerns/has_item_type.rb', line 33

def is_sidebar?
  self.class.ancestors.include?(Avo::Resources::Items::Sidebar)
end

#is_tab?Boolean

Returns:

  • (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

Returns:

  • (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

Returns:

  • (Boolean)


21
22
23
# File 'lib/avo/concerns/has_item_type.rb', line 21

def is_tool?
  self.class.ancestors.include?(Avo::BaseResourceTool)
end