Class: Yoda::Parsing::Query::CurrentNodeCommentQuery

Inherits:
Object
  • Object
show all
Defined in:
lib/yoda/parsing/query/current_node_comment_query.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(comments, location) ⇒ CurrentNodeCommentQuery

Returns a new instance of CurrentNodeCommentQuery.

Parameters:

  • ast (::Parser::AST::Node)
  • comments (Array<::Parser::Source::Comment>)
  • location (Location)


10
11
12
13
14
# File 'lib/yoda/parsing/query/current_node_comment_query.rb', line 10

def initialize(comments, location)
  @ast = ast
  @comments = comments
  @location = location
end

Instance Attribute Details

#astObject (readonly)

Returns the value of attribute ast.



5
6
7
# File 'lib/yoda/parsing/query/current_node_comment_query.rb', line 5

def ast
  @ast
end

#commentsObject (readonly)

Returns the value of attribute comments.



5
6
7
# File 'lib/yoda/parsing/query/current_node_comment_query.rb', line 5

def comments
  @comments
end

#locationObject (readonly)

Returns the value of attribute location.



5
6
7
# File 'lib/yoda/parsing/query/current_node_comment_query.rb', line 5

def location
  @location
end

Instance Method Details

#current_commenting_nodeArray<::Parser::Source::Comment>

Returns:

  • (Array<::Parser::Source::Comment>)


17
18
19
# File 'lib/yoda/parsing/query/current_node_comment_query.rb', line 17

def current_commenting_node
  @current_commenting_node ||= inverse_association[current_comment_block]
end