Sha256: 9dec346f10b6ac40bdd9e3987256497e6ea464c2b6efa2790e1f742bc6508f95

Contents?: true

Size: 823 Bytes

Versions: 13

Compression:

Stored size: 823 Bytes

Contents

# typed: strict
require('parlour')
require('sorbet-rails/model_utils')
module SorbetRails::ModelPlugins
  class Base < ::Parlour::Plugin
    extend T::Sig
    extend T::Helpers
    include SorbetRails::ModelUtils

    abstract!

    # convenient rename
    Parameter = ::Parlour::RbiGenerator::Parameter

    sig { override.returns(T.class_of(ActiveRecord::Base)) }
    attr_reader :model_class

    sig { returns(T::Set[String]) }
    attr_reader :available_classes

    sig {
      params(
        model_class: T.class_of(ActiveRecord::Base),
        available_classes: T::Set[String],
      ).
      void
    }
    def initialize(model_class, available_classes)
      @model_class = T.let(model_class, T.class_of(ActiveRecord::Base))
      @available_classes = T.let(available_classes, T::Set[String])
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
sorbet-rails-0.7.2 lib/sorbet-rails/model_plugins/base.rb
sorbet-rails-0.7.1 lib/sorbet-rails/model_plugins/base.rb
sorbet-rails-0.6.2 lib/sorbet-rails/model_plugins/base.rb
sorbet-rails-0.6.1 lib/sorbet-rails/model_plugins/base.rb
sorbet-rails-0.6.0 lib/sorbet-rails/model_plugins/base.rb
sorbet-rails-0.5.9.1 lib/sorbet-rails/model_plugins/base.rb
sorbet-rails-0.5.9 lib/sorbet-rails/model_plugins/base.rb
sorbet-rails-0.5.8.1 lib/sorbet-rails/model_plugins/base.rb
sorbet-rails-0.5.8 lib/sorbet-rails/model_plugins/base.rb
sorbet-rails-0.5.7 lib/sorbet-rails/model_plugins/base.rb
sorbet-rails-0.5.6 lib/sorbet-rails/model_plugins/base.rb
sorbet-rails-0.5.5.1 lib/sorbet-rails/model_plugins/base.rb
sorbet-rails-0.5.5 lib/sorbet-rails/model_plugins/base.rb