class ActiveSupport::CodeGenerator::MethodSet
Experimental RBS support (using type sampling data from the type_fusion
project).
# sig/active_support/code_generator.rbs class ActiveSupport::CodeGenerator::MethodSet def apply: (ActiveRecord::AttributeMethods::GeneratedAttributeMethods owner, String path, Integer line) -> untyped def define_cached_method: (Symbol name, as: Symbol) -> Symbol def initialize: (Symbol namespace) -> void end
:nodoc:
def apply(owner, path, line)
Experimental RBS support (using type sampling data from the type_fusion
project).
def apply: (ActiveRecord::AttributeMethods::GeneratedAttributeMethods owner, String path, Integer line) -> untyped
This signature was generated using 7 samples from 1 application.
def apply(owner, path, line) unless @sources.empty? @cache.module_eval("# frozen_string_literal: true\n" + @sources.join(";"), path, line) end @methods.each do |name, as| owner.define_method(name, @cache.instance_method(as)) end end
def define_cached_method(name, as: name)
Experimental RBS support (using type sampling data from the type_fusion
project).
def define_cached_method: (Symbol name, as: Symbol) -> Symbol
This signature was generated using 137 samples from 2 applications.
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
def initialize(namespace)
Experimental RBS support (using type sampling data from the type_fusion
project).
def initialize: (Symbol namespace) -> void
This signature was generated using 8 samples from 1 application.
def initialize(namespace) @cache = METHOD_CACHES[namespace] @sources = [] @methods = {} end