Sha256: 27ff64de70d09ca198212585d66a227fd3b369f943b70dc6cd665c52632558ee

Contents?: true

Size: 817 Bytes

Versions: 80

Compression:

Stored size: 817 Bytes

Contents

module Avo
  class BaseResourceTool
    prepend Avo::Concerns::IsResourceItem

    include Avo::Concerns::HasItemType
    include Avo::Concerns::IsVisible
    include Avo::Concerns::VisibleInDifferentViews
    include Avo::Concerns::Hydration

    class_attribute :name
    class_attribute :partial

    attr_accessor :params
    attr_accessor :parent
    attr_accessor :resource
    attr_accessor :view

    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

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

      self.class.to_s.underscore
    end
  end
end

Version data entries

80 entries across 80 versions & 1 rubygems

Version Path
avo-3.16.4 lib/avo/base_resource_tool.rb
avo-3.16.3 lib/avo/base_resource_tool.rb
avo-3.16.2 lib/avo/base_resource_tool.rb
avo-3.16.1 lib/avo/base_resource_tool.rb
avo-3.16.0 lib/avo/base_resource_tool.rb
avo-3.15.7 lib/avo/base_resource_tool.rb
avo-3.15.6 lib/avo/base_resource_tool.rb
avo-3.15.5 lib/avo/base_resource_tool.rb
avo-3.15.4 lib/avo/base_resource_tool.rb
avo-3.15.3 lib/avo/base_resource_tool.rb
avo-3.15.2 lib/avo/base_resource_tool.rb
avo-3.15.1 lib/avo/base_resource_tool.rb
avo-3.15.0 lib/avo/base_resource_tool.rb
avo-3.14.5 lib/avo/base_resource_tool.rb
avo-3.14.4 lib/avo/base_resource_tool.rb
avo-3.14.3 lib/avo/base_resource_tool.rb
avo-3.14.2 lib/avo/base_resource_tool.rb
avo-3.14.1 lib/avo/base_resource_tool.rb
avo-3.14.0 lib/avo/base_resource_tool.rb
avo-3.13.7 lib/avo/base_resource_tool.rb