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

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(block, association) ⇒ Reference

Returns a new instance of Reference.



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

#blockObject (readonly)

Returns the value of attribute block.



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

def block
  @block
end

Instance Method Details

#associate!Object



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