class ActiveSupport::CodeGenerator

Experimental RBS support (using type sampling data from the type_fusion project).

# sig/active_support/code_generator.rbs

class ActiveSupport::CodeGenerator
  def batch: (ActiveSupport::CodeGenerator owner, String path, Integer line) -> untyped
  def define_cached_method: (String name, namespace: Symbol, as: String, ) -> untyped
end

:nodoc:

def batch(owner, path, line)

Experimental RBS support (using type sampling data from the type_fusion project).

def batch: (ActiveSupport::CodeGenerator owner, String path, Integer line) -> untyped

This signature was generated using 1 sample from 1 application.

def batch(owner, path, line)
  if owner.is_a?(CodeGenerator)
    yield owner
  else
    instance = new(owner, path, line)
    result = yield instance
    instance.execute
    result
  end
end

def define_cached_method(name, namespace:, as: name, &block)

Experimental RBS support (using type sampling data from the type_fusion project).

def define_cached_method: (String name, namespace: Symbol, as: String, ) -> untyped

This signature was generated using 14 samples from 1 application.

def define_cached_method(name, namespace:, as: name, &block)
  @namespaces[namespace].define_cached_method(name, as: as, &block)
end

def execute

def execute
  @namespaces.each_value do |method_set|
    method_set.apply(@owner, @path, @line - 1)
  end
end

def initialize(owner, path, line)

def initialize(owner, path, line)
  @owner = owner
  @path = path
  @line = line
  @namespaces = Hash.new { |h, k| h[k] = MethodSet.new(k) }
end