Sha256: 27ff64de70d09ca198212585d66a227fd3b369f943b70dc6cd665c52632558ee

Contents?: true

Size: 817 Bytes

Versions: 67

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

67 entries across 67 versions & 1 rubygems

Version Path
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
avo-3.13.6 lib/avo/base_resource_tool.rb
avo-3.13.5 lib/avo/base_resource_tool.rb
avo-3.13.4 lib/avo/base_resource_tool.rb
avo-3.13.3 lib/avo/base_resource_tool.rb
avo-3.13.2 lib/avo/base_resource_tool.rb
avo-3.13.1 lib/avo/base_resource_tool.rb
avo-3.13.0 lib/avo/base_resource_tool.rb
avo-3.12.0 lib/avo/base_resource_tool.rb
avo-3.11.10 lib/avo/base_resource_tool.rb
avo-3.11.9 lib/avo/base_resource_tool.rb
avo-3.11.8 lib/avo/base_resource_tool.rb
avo-3.11.7 lib/avo/base_resource_tool.rb
avo-3.11.6 lib/avo/base_resource_tool.rb