instance method
define_cached_method
Ruby on Rails 7.0.10
Since v7.0.10Signature
define_cached_method(name, as: name)
No documentation comment.
Parameters
-
namereq -
askey = 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