Class: RBS::InlineParser::CommentAssociation::Reference
- Inherits:
-
Object
- Object
- RBS::InlineParser::CommentAssociation::Reference
- Defined in:
- lib/rbs/inline_parser/comment_association.rb
Instance Attribute Summary collapse
-
#block ⇒ Object
readonly
Returns the value of attribute block.
Instance Method Summary collapse
- #associate! ⇒ Object
- #associated? ⇒ Boolean
-
#initialize(block, association) ⇒ Reference
constructor
A new instance of Reference.
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
#block ⇒ Object (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
42 43 44 |
# File 'lib/rbs/inline_parser/comment_association.rb', line 42 def associated? @associated_blocks.include?(block) end |