Class: Tapioca::Compilers::Attrables

Inherits:
Dsl::Compiler
  • Object
show all
Defined in:
sorbet/tapioca/compilers/attrables.rb

Constant Summary collapse

ATTRABLE_FILENAME =
"attrable.rb"
ConstantType =
type_member { { fixed: Module } }

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.gather_constantsEnumerable<Module>

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Returns:



15
# File 'sorbet/tapioca/compilers/attrables.rb', line 15

def self.gather_constants = Homebrew::Tapioca::Utils.named_objects_with_module(Attrable)

Instance Method Details

#decoratevoid

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

This method returns an undefined value.



18
19
20
21
22
23
24
25
# File 'sorbet/tapioca/compilers/attrables.rb', line 18

def decorate
  root.create_path(constant) do |klass|
    Homebrew::Tapioca::Utils.methods_from_file(constant, ATTRABLE_FILENAME)
                            .each { |method| compile_attrable_method(klass, method) }
    Homebrew::Tapioca::Utils.methods_from_file(constant, ATTRABLE_FILENAME, class_methods: true)
                            .each { |method| compile_attrable_method(klass, method, class_method: true) }
  end
end