Class: RBS::InlineParser::CommentAssociation::Reference

Inherits:
Object
  • Object
show all
Defined in:
lib/rbs/inline_parser/comment_association.rb,
sig/inline_parser/comment_association.rbs

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(block, association) ⇒ Reference

Returns a new instance of Reference.

Parameters:

  • (CommentBlock)
  • (Set[CommentBlock])


32
33
34
35
# File 'lib/rbs/inline_parser/comment_association.rb', line 32

def initialize(block, association)
  @block = block
  @associated_blocks = association
end

Instance Attribute Details

#blockCommentBlock (readonly)

Returns the value of attribute block.

Returns:

  • (CommentBlock)


30
31
32
# File 'lib/rbs/inline_parser/comment_association.rb', line 30

def block
  @block
end

Instance Method Details

#associate!self

Returns:

  • (self)


37
38
39
40
# File 'lib/rbs/inline_parser/comment_association.rb', line 37

def associate!
  @associated_blocks << block
  self
end

#associated?Boolean

Returns:

  • (Boolean)


42
43
44
# File 'lib/rbs/inline_parser/comment_association.rb', line 42

def associated?
  @associated_blocks.include?(block)
end