Sha256: 93687d356e4fa701086fb1f24f7c9fca7af82ebcdbaea467d10e3e8eadb48c9f

Contents?: true

Size: 1.23 KB

Versions: 3

Compression:

Stored size: 1.23 KB

Contents

# frozen_string_literal: true

require "phlex"

module Plutonium
  module UI
    module Component
      module Methods
        extend ActiveSupport::Concern

        private

        def resource_class
          helpers.controller.send(:resource_class)
        end

        def resource_record
          helpers.controller.send(:resource_record)
        end

        def current_parent
          helpers.controller.send(:current_parent)
        end

        def params
          helpers.controller.params
        end

        def request
          helpers.controller.request
        end

        def pagy_instance
          helpers.controller.instance_variable_get(:@pagy)
        end

        delegate \
          :resource_name,
          :resource_name_plural,
          :display_name_of,
          :resource_url_for,
          :current_user,
          :current_definition,
          :current_query_object,
          :raw_resource_query_params,
          :current_policy,
          :current_turbo_frame,
          :current_interactive_action,
          :current_engine,
          :policy_for,
          :authorized_resource_scope,
          :allowed_to?,
          :registered_resources,
          :root_path,
          to: :helpers
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
plutonium-0.16.3 lib/plutonium/ui/component/methods.rb
plutonium-0.16.1 lib/plutonium/ui/component/methods.rb
plutonium-0.16.0 lib/plutonium/ui/component/methods.rb