Sha256: f2173064dcab3a6bfb629e10fb54bf298ba07cc21a727eb2a60749b73432cb1e

Contents?: true

Size: 819 Bytes

Versions: 79

Compression:

Stored size: 819 Bytes

Contents

# frozen_string_literal: true
# typed: true

# Use as a mixin with extend (`extend T::Helpers`).
# Docs at https://confluence.corp.stripe.com/display/PRODINFRA/Ruby+Types
module T::Helpers
  Private = T::Private

  ### Class/Module Helpers ###

  def abstract!
    Private::Abstract::Declare.declare_abstract(self, type: :abstract)
  end

  def interface!
    Private::Abstract::Declare.declare_abstract(self, type: :interface)
  end

  def final!
    Private::Final.declare(self)
  end

  # Causes a mixin to also mix in class methods from the named module.
  #
  # Nearly equivalent to
  #
  #  def self.included(other)
  #    other.extend(mod)
  #  end
  #
  # Except that it is statically analyzed by sorbet.
  def mixes_in_class_methods(mod)
    Private::Mixins.declare_mixes_in_class_methods(self, mod)
  end
end

Version data entries

79 entries across 79 versions & 1 rubygems

Version Path
sorbet-runtime-0.4.4524 lib/types/helpers.rb
sorbet-runtime-0.4.4523 lib/types/helpers.rb
sorbet-runtime-0.4.4521 lib/types/helpers.rb
sorbet-runtime-0.4.4522 lib/types/helpers.rb
sorbet-runtime-0.4.4519 lib/types/helpers.rb
sorbet-runtime-0.4.4520 lib/types/helpers.rb
sorbet-runtime-0.4.4518 lib/types/helpers.rb
sorbet-runtime-0.4.4517 lib/types/helpers.rb
sorbet-runtime-0.4.4516 lib/types/helpers.rb
sorbet-runtime-0.4.4515 lib/types/helpers.rb
sorbet-runtime-0.4.4514 lib/types/helpers.rb
sorbet-runtime-0.4.4513 lib/types/helpers.rb
sorbet-runtime-0.4.4512 lib/types/helpers.rb
sorbet-runtime-0.4.4511 lib/types/helpers.rb
sorbet-runtime-0.4.4510 lib/types/helpers.rb
sorbet-runtime-0.4.4507 lib/types/helpers.rb
sorbet-runtime-0.4.4506 lib/types/helpers.rb
sorbet-runtime-0.4.4505 lib/types/helpers.rb
sorbet-runtime-0.4.4504 lib/types/helpers.rb
sorbet-runtime-0.4.4503 lib/types/helpers.rb