instance method define_cached_method

Ruby on Rails 7.0.10

Since v7.0.10

Available in: v7.0.10 v7.1.6 v7.2.3 v8.0.4 v8.1.2

Signature

define_cached_method(name, as: name)

No documentation comment.

Parameters

name req
as key = name
Source
# File activesupport/lib/active_support/code_generator.rb, line 14
      def define_cached_method(name, as: name)
        name = name.to_sym
        as = as.to_sym
        @methods.fetch(name) do
          unless @cache.method_defined?(as)
            yield @sources
          end
          @methods[name] = as
        end
      end

Defined in activesupport/lib/active_support/code_generator.rb line 14 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveSupport::CodeGenerator::MethodSet

Type at least 2 characters to search.

↑↓ navigate · open · esc close