Class: LibRubyParser::Comment

Inherits:
Object
  • Object
show all
Defined in:
lib/lib-ruby-parser.rb

Overview

A class that represents a comment in Ruby

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(location:, kind:) ⇒ Comment

Returns a new instance of Comment.

Parameters:

  • location (Loc)
  • kind (Symbol)


112
113
114
115
# File 'lib/lib-ruby-parser.rb', line 112

def initialize(location:, kind:)
  @location = location
  @kind = kind
end

Instance Attribute Details

#kindSymbol

Kind of the comment (+:inline+ or +:document+ or +:unknown+)

Returns:

  • (Symbol)

    +:inline+ or +:document+ or +:unknown+



108
109
110
# File 'lib/lib-ruby-parser.rb', line 108

def kind
  @kind
end

#locationLoc

Location of the comment (starts with # and ends with the last char)

Returns:



103
104
105
# File 'lib/lib-ruby-parser.rb', line 103

def location
  @location
end