Don't need to recreate method by hand

This commit is contained in:
Michael Miller 2022-03-12 11:08:29 -07:00
parent 76c1d6a096
commit d891422b3a
No known key found for this signature in database
GPG key ID: 32B47AE8F388A1FF

View file

@ -5,13 +5,7 @@ module Spectator
{% raise "Cannot stub method with reserved keyword as name - #{method.name}" if ::Spectator::DSL::RESERVED_KEYWORDS.includes?(method.name.symbolize) %}
{% unless method.abstract? %}
{% if method.visibility != :public %}{{method.visibility.id}}{% end %} def {{method.receiver}}{{method.name}}(
{{method.args.splat(",")}}
{% if method.double_splat %}**{{method.double_splat}}, {% end %}
{% if method.block_arg %}&{{method.block_arg}}{% elsif method.accepts_block? %}&{% end %}
){% if method.return_type %} : {{method.return_type}}{% end %}{% if !method.free_vars.empty? %} forall {{method.free_vars.splat}}{% end %}
{{method.body}}
end
{{method}}
{% end %}
{% if method.visibility != :public %}{{method.visibility.id}}{% end %} def {{method.receiver}}{{method.name}}(