Sha256: 572324fb20b9b65d01d3b103bf2387994a12c0d7cf68986bab8d97653fd2892a
Contents?: true
Size: 931 Bytes
Versions: 25
Compression:
Stored size: 931 Bytes
Contents
# This concern helps us figure out what kind of items (field, tool, tab_group, or panel) have been passed to the resource or action. module Avo module Concerns module IsResourceItem extend ActiveSupport::Concern included do class_attribute :item_type, default: nil end def is_field? self.class.item_type == :field end def is_panel? self.class.item_type == :panel || self.class.item_type == :main_panel end def is_main_panel? self.class.item_type == :main_panel end def is_tool? self.class.item_type == :tool end def is_tab? self.class.item_type == :tab end def is_tab_group? self.class.item_type == :tab_group end def is_sidebar? self.class.item_type == :sidebar end def is_row? self.class.item_type == :row end end end end
Version data entries
25 entries across 25 versions & 1 rubygems