Class: Avo::BaseResourceTool
- Inherits:
-
Object
- Object
- Avo::BaseResourceTool
- Includes:
- Concerns::HasItemType, Concerns::Hydration, Concerns::IsResourceItem, Concerns::IsVisible, Concerns::VisibleInDifferentViews
- Defined in:
- lib/avo/base_resource_tool.rb
Instance Attribute Summary collapse
-
#params ⇒ Object
Returns the value of attribute params.
-
#parent ⇒ Object
Returns the value of attribute parent.
-
#resource ⇒ Object
Returns the value of attribute resource.
-
#view ⇒ Object
Returns the value of attribute view.
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
Instance Method Summary collapse
-
#initialize(**args) ⇒ BaseResourceTool
constructor
A new instance of BaseResourceTool.
- #partial ⇒ Object
Methods included from Concerns::Hydration
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
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
Constructor Details
#initialize(**args) ⇒ BaseResourceTool
Returns a new instance of BaseResourceTool.
18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/avo/base_resource_tool.rb', line 18 def initialize(**args) # Set the visibility only_on Avo.configuration.resource_default_view @args = args @parent = args[:parent] @resource = args[:parent] @view = args[:view] post_initialize if respond_to?(:post_initialize) end |
Instance Attribute Details
#params ⇒ Object
Returns the value of attribute params.
13 14 15 |
# File 'lib/avo/base_resource_tool.rb', line 13 def params @params end |
#parent ⇒ Object
Returns the value of attribute parent.
14 15 16 |
# File 'lib/avo/base_resource_tool.rb', line 14 def parent @parent end |
#resource ⇒ Object
Returns the value of attribute resource.
15 16 17 |
# File 'lib/avo/base_resource_tool.rb', line 15 def resource @resource end |
#view ⇒ Object
Returns the value of attribute view.
16 17 18 |
# File 'lib/avo/base_resource_tool.rb', line 16 def view @view end |
Instance Method Details
#partial ⇒ Object
30 31 32 33 34 |
# File 'lib/avo/base_resource_tool.rb', line 30 def partial return self.class.partial if self.class.partial.present? self.class.to_s.underscore end |