lib/tapioca/dsl/compilers/action_mailer.rb in tapioca-0.11.1 vs lib/tapioca/dsl/compilers/action_mailer.rb in tapioca-0.11.2
- old
+ new
@@ -39,11 +39,11 @@
ConstantType = type_member { { fixed: T.class_of(::ActionMailer::Base) } }
sig { override.void }
def decorate
root.create_path(constant) do |mailer|
- constant.action_methods.to_a.each do |mailer_method|
+ action_methods_for_constant.each do |mailer_method|
method_def = constant.instance_method(mailer_method)
parameters = compile_method_parameters_to_rbi(method_def)
mailer.create_method(
mailer_method,
parameters: parameters,
@@ -59,9 +59,16 @@
sig { override.returns(T::Enumerable[Module]) }
def gather_constants
descendants_of(::ActionMailer::Base).reject(&:abstract?)
end
+ end
+
+ private
+
+ sig { returns(T::Array[String]) }
+ def action_methods_for_constant
+ constant.action_methods.to_a
end
end
end
end
end