Sha256: 445b448d3092ba1c1304ffa001a28b8e4593083a6d54e648af72624e18dd57ab

Contents?: true

Size: 1.23 KB

Versions: 26

Compression:

Stored size: 1.23 KB

Contents

# typed: strict
class ElasticSearchPlugin < SorbetRails::ModelPlugins::Base
  sig { override.params(root: Parlour::RbiGenerator::Namespace).void }
  def generate(root)
    return unless @model_class.include?(::Elasticsearch::Model)

    model_rbi = root.create_class(model_class_name)
    model_rbi.create_method(
      'mapping',
      class_method: true,
      parameters: [
        ::Parlour::RbiGenerator::Parameter.new(
          "options",
          type: "T.nilable(T::Hash[Symbol, T.untyped])", default: 'nil',
        ),
        ::Parlour::RbiGenerator::Parameter.new(
          "&block",
          type: "T.proc.bind(Elasticsearch::Model::Indexing::Mappings).void",
        )
      ],
      return_type: "Elasticsearch::Model::Indexing::Mappings",
    )

    model_rbi.create_method(
      'mappings',
      class_method: true,
      parameters: [
        ::Parlour::RbiGenerator::Parameter.new(
          "options",
          type: "T.nilable(T::Hash[Symbol, T.untyped])", default: 'nil',
        ),
        ::Parlour::RbiGenerator::Parameter.new(
          "&block",
          type: "T.proc.bind(Elasticsearch::Model::Indexing::Mappings).void",
        )
      ],
      return_type: "Elasticsearch::Model::Indexing::Mappings",
    )
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
sorbet-rails-0.7.34 lib/sorbet-rails/gem_plugins/elastic_search_plugin.rb
sorbet-rails-0.7.33 lib/sorbet-rails/gem_plugins/elastic_search_plugin.rb
sorbet-rails-0.7.32 lib/sorbet-rails/gem_plugins/elastic_search_plugin.rb
sorbet-rails-0.7.31 lib/sorbet-rails/gem_plugins/elastic_search_plugin.rb
sorbet-rails-0.7.27 lib/sorbet-rails/gem_plugins/elastic_search_plugin.rb
sorbet-rails-0.7.26 lib/sorbet-rails/gem_plugins/elastic_search_plugin.rb
sorbet-rails-0.7.25 lib/sorbet-rails/gem_plugins/elastic_search_plugin.rb
sorbet-rails-0.7.24 lib/sorbet-rails/gem_plugins/elastic_search_plugin.rb
sorbet-rails-0.7.23 lib/sorbet-rails/gem_plugins/elastic_search_plugin.rb
sorbet-rails-0.7.22 lib/sorbet-rails/gem_plugins/elastic_search_plugin.rb
sorbet-rails-0.7.20 lib/sorbet-rails/gem_plugins/elastic_search_plugin.rb
sorbet-rails-0.7.19 lib/sorbet-rails/gem_plugins/elastic_search_plugin.rb
sorbet-rails-0.7.18 lib/sorbet-rails/gem_plugins/elastic_search_plugin.rb
sorbet-rails-0.7.5 lib/sorbet-rails/gem_plugins/elastic_search_plugin.rb
sorbet-rails-0.7.4 lib/sorbet-rails/gem_plugins/elastic_search_plugin.rb
sorbet-rails-0.7.3 lib/sorbet-rails/gem_plugins/elastic_search_plugin.rb
sorbet-rails-0.7.2 lib/sorbet-rails/gem_plugins/elastic_search_plugin.rb
sorbet-rails-0.7.1 lib/sorbet-rails/gem_plugins/elastic_search_plugin.rb
sorbet-rails-0.7.0 lib/sorbet-rails/gem_plugins/elastic_search_plugin.rb
sorbet-rails-0.6.5.1 lib/sorbet-rails/gem_plugins/elastic_search_plugin.rb