diff --git a/lib/ruby-lint/constant_path.rb b/lib/ruby-lint/constant_path.rb index b6a7ce7..e4152ab 100644 --- a/lib/ruby-lint/constant_path.rb +++ b/lib/ruby-lint/constant_path.rb @@ -31,7 +31,7 @@ def initialize(node) # # @param [RubyLint::Definition::RubyObject] scope The scope to use for the # lookups. - # @return [RubyLint::Definition::RubyObject] + # @return [RubyLint::Definition::RubyObject|NilClass] # def resolve(scope) current = scope @@ -78,7 +78,7 @@ def to_s # Returns an Array containing the segments of a constant path. # # @param [RubyLint::AST::Node] node - # @return [Array] + # @return [Array] # def constant_segments(node = self.node) segments = [] diff --git a/lib/ruby-lint/definition/ruby_object.rb b/lib/ruby-lint/definition/ruby_object.rb index ec88f04..6c580de 100644 --- a/lib/ruby-lint/definition/ruby_object.rb +++ b/lib/ruby-lint/definition/ruby_object.rb @@ -37,10 +37,12 @@ module Definition # @return [Symbol] The type of object, e.g. `:const`. # # @!attribute [r] definitions - # @return [Hash] Hash containing all child the definitions. + # @return [Hash{Symbol => Hash{String => Object}}] + # Hash keyed by type and name, containing all child the definitions. # # @!attribute [rw] parents - # @return [Array] Array containing the parent definitions. + # @return [Array] + # Array containing the parent definitions. # # @!attribute [rw] reference_amount # @return [Numeric] The amount of times an object was referenced. @@ -51,7 +53,7 @@ module Definition # instance. # # @!attribute [r] update_parents - # @return [Array] A list of data types to also add to the parent + # @return [Array] A list of data types to also add to the parent # definitions when adding an object to the current one. # # @!attribute [r] members_as_value @@ -79,7 +81,7 @@ class RubyObject # Array containing items that should be looked up in the parent # definition if they're not found in the current one. # - # @return [Array] + # @return [Array] # LOOKUP_PARENT = [ :const, @@ -264,7 +266,8 @@ def add(type, name, value) # @param [TrueClass|FalseClass] lookup_parent Whether definitions should # be looked up from parent definitions. # - # @param [Array] exclude A list of definitions to skip when looking up + # @param [Array] exclude + # A list of definitions to skip when looking up # parents. This list is used to prevent stack errors when dealing with # recursive definitions. A good example of this is `Logger` and # `Logger::Severity` which both inherit from each other. @@ -374,7 +377,8 @@ def call(context = self) # # @param [#to_sym] type # @param [String] name - # @param [Array] exclude Parent definitions to exclude. + # @param [Array] exclude + # Parent definitions to exclude. # @return [TrueClass|FalseClass] # def has_definition?(type, name, exclude = []) @@ -697,7 +701,7 @@ def update_parent_definitions(type, name, value) # @param [RubyLint::Definition::RubyObject] parent # @param [Symbol] type # @param [String] name - # @param [Array] exclude + # @param [Array] exclude # @return [RubyLint::Definition::RubyObject] # def determine_parent(parent, type, name, exclude = []) @@ -769,7 +773,7 @@ def lookup_parent?(type) # # @param [#to_sym] type # @param [#to_s] name - # @return [Array] + # @return [Array(Symbol,String)] # def prepare_lookup(type, name) return type.to_sym, name.to_s