Class: Avo::BaseResourceTool

Inherits:
Object
  • Object
show all
Includes:
Concerns::HasItemType, Concerns::IsResourceItem, Concerns::IsVisible, Concerns::VisibleInDifferentViews
Defined in:
lib/avo/base_resource_tool.rb

Instance Attribute Summary collapse

Attributes included from Concerns::VisibleInDifferentViews

#show_on_edit, #show_on_index, #show_on_new, #show_on_preview, #show_on_show

Attributes included from Concerns::IsVisible

#visible

Attributes included from Concerns::IsResourceItem

#resource, #view

Instance Method Summary collapse

Methods included from Concerns::VisibleInDifferentViews

#except_on, #hide_on, #initialize_views, #only_on, #post_initialize, #show_on, #show_on_create, #show_on_update, #visible_in_view?

Methods included from Concerns::IsVisible

#visible?

Methods included from Concerns::HasItemType

#is_field?, #is_heading?, #is_main_panel?, #is_panel?, #is_row?, #is_sidebar?, #is_tab?, #is_tab_group?, #is_tool?

Methods included from Concerns::IsResourceItem

#hydrate, #visible?

Constructor Details

#initialize(**args) ⇒ BaseResourceTool

Returns a new instance of BaseResourceTool.



14
15
16
17
18
19
20
21
# File 'lib/avo/base_resource_tool.rb', line 14

def initialize(**args)
  # Set the visibility
  only_on Avo.configuration.resource_default_view

  @args = args

  post_initialize if respond_to?(:post_initialize)
end

Instance Attribute Details

#paramsObject

Returns the value of attribute params.



12
13
14
# File 'lib/avo/base_resource_tool.rb', line 12

def params
  @params
end

Instance Method Details

#partialObject



23
24
25
26
27
# File 'lib/avo/base_resource_tool.rb', line 23

def partial
  return self.class.partial if self.class.partial.present?

  self.class.to_s.underscore
end