Sha256: 1b21e11465f044dd26faf96162a0d49b051117be1ca8b3cf5ac444278a929561
Contents?: true
Size: 731 Bytes
Versions: 23
Compression:
Stored size: 731 Bytes
Contents
# typed: strict require ('sorbet-rails/model_plugins/base') class SorbetRails::ModelPlugins::EnumerableCollections < SorbetRails::ModelPlugins::Base sig { override.params(root: Parlour::RbiGenerator::Namespace).void } def generate(root) model_assoc_proxy_class_rbi = root.create_class(self.model_assoc_proxy_class_name) # following methods only exists in an association proxy ["<<", "append", "push", "concat"].each do |method_name| elem = self.model_class_name model_assoc_proxy_class_rbi.create_method( method_name, parameters: [ Parameter.new("*records", type: "T.any(#{elem}, T::Array[#{elem}])"), ], return_type: "T.self_type", ) end end end
Version data entries
23 entries across 23 versions & 1 rubygems