Skip to content
This repository has been archived by the owner on Mar 16, 2023. It is now read-only.

Commit

Permalink
Yardoc improvements.
Browse files Browse the repository at this point in the history
  • Loading branch information
mvidner committed Jun 28, 2016
1 parent ecf4676 commit e599902
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
4 changes: 2 additions & 2 deletions lib/ruby-lint/constant_path.rb
Expand Up @@ -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
Expand Down Expand Up @@ -78,7 +78,7 @@ def to_s
# Returns an Array containing the segments of a constant path.
#
# @param [RubyLint::AST::Node] node
# @return [Array<String>]
# @return [Array<Array(Symbol,String)>]
#
def constant_segments(node = self.node)
segments = []
Expand Down
20 changes: 12 additions & 8 deletions lib/ruby-lint/definition/ruby_object.rb
Expand Up @@ -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<RubyLint::Definition::RubyObject>]
# Array containing the parent definitions.
#
# @!attribute [rw] reference_amount
# @return [Numeric] The amount of times an object was referenced.
Expand All @@ -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<Symbol>] 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
Expand Down Expand Up @@ -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<Symbol>]
#
LOOKUP_PARENT = [
:const,
Expand Down Expand Up @@ -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<RubyLint::Definition::RubyObject>] 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.
Expand Down Expand Up @@ -374,7 +377,8 @@ def call(context = self)
#
# @param [#to_sym] type
# @param [String] name
# @param [Array] exclude Parent definitions to exclude.
# @param [Array<RubyLint::Definition::RubyObject>] exclude
# Parent definitions to exclude.
# @return [TrueClass|FalseClass]
#
def has_definition?(type, name, exclude = [])
Expand Down Expand Up @@ -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<RubyLint::Definition::RubyObject>] exclude
# @return [RubyLint::Definition::RubyObject]
#
def determine_parent(parent, type, name, exclude = [])
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit e599902

Please sign in to comment.