Class: Tapioca::Compilers::Dsl::Base

Inherits:
Object
  • Object
show all
Extended by:
T::Helpers, T::Sig
Includes:
Reflection
Defined in:
lib/tapioca/compilers/dsl/base.rb

Constant Summary

Constants included from Reflection

Reflection::ANCESTORS_METHOD, Reflection::CLASS_METHOD, Reflection::CONSTANTS_METHOD, Reflection::EQUAL_METHOD, Reflection::METHOD_METHOD, Reflection::NAME_METHOD, Reflection::OBJECT_ID_METHOD, Reflection::PRIVATE_INSTANCE_METHODS_METHOD, Reflection::PROTECTED_INSTANCE_METHODS_METHOD, Reflection::PUBLIC_INSTANCE_METHODS_METHOD, Reflection::SINGLETON_CLASS_METHOD, Reflection::SUPERCLASS_METHOD

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Reflection

#ancestors_of, #are_equal?, #class_of, #constants_of, #descendants_of, #inherited_ancestors_of, #method_of, #name_of, #name_of_type, #object_id_of, #private_instance_methods_of, #protected_instance_methods_of, #public_instance_methods_of, #qualified_name_of, #signature_of, #singleton_class_of, #superclass_of

Constructor Details

#initializeBase

Returns a new instance of Base.



26
27
28
29
# File 'lib/tapioca/compilers/dsl/base.rb', line 26

def initialize
  @processable_constants = T.let(Set.new(gather_constants), T::Set[Module])
  @errors = T.let([], T::Array[String])
end

Instance Attribute Details

#errorsObject (readonly)

Returns the value of attribute errors.



23
24
25
# File 'lib/tapioca/compilers/dsl/base.rb', line 23

def errors
  @errors
end

#processable_constantsObject (readonly)

Returns the value of attribute processable_constants.



20
21
22
# File 'lib/tapioca/compilers/dsl/base.rb', line 20

def processable_constants
  @processable_constants
end

Instance Method Details

#add_error(error) ⇒ Object



52
53
54
# File 'lib/tapioca/compilers/dsl/base.rb', line 52

def add_error(error)
  @errors << error
end

#decorate(tree, constant) ⇒ Object



45
# File 'lib/tapioca/compilers/dsl/base.rb', line 45

def decorate(tree, constant); end

#gather_constantsObject



48
# File 'lib/tapioca/compilers/dsl/base.rb', line 48

def gather_constants; end

#handles?(constant) ⇒ Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/tapioca/compilers/dsl/base.rb', line 32

def handles?(constant)
  processable_constants.include?(constant)
end