Sha256: 9c840e021feafd15e02d60a230f13117cb807e190352179112359943fe5cbb28

Contents?: true

Size: 1.2 KB

Versions: 9

Compression:

Stored size: 1.2 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,
          :allowed_to?,
          :registered_resources,
          :root_path,
          to: :helpers
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
plutonium-0.15.24 lib/plutonium/ui/component/methods.rb
plutonium-0.15.23 lib/plutonium/ui/component/methods.rb
plutonium-0.15.22 lib/plutonium/ui/component/methods.rb
plutonium-0.15.21 lib/plutonium/ui/component/methods.rb
plutonium-0.15.20 lib/plutonium/ui/component/methods.rb
plutonium-0.15.19 lib/plutonium/ui/component/methods.rb
plutonium-0.15.18 lib/plutonium/ui/component/methods.rb
plutonium-0.15.17 lib/plutonium/ui/component/methods.rb
plutonium-0.15.16 lib/plutonium/ui/component/methods.rb