Class: RBS::Inline::AST::Annotations::ModuleSelf
- Defined in:
- lib/rbs/inline/ast/annotations.rb
Overview
‘# @rbs module-self [MODULE_SELF]`
Instance Attribute Summary collapse
-
#comment ⇒ Object
readonly
: String?.
-
#constraint ⇒ Object
readonly
: RBS::AST::Declarations::Module::Self?.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(tree, source) ⇒ ModuleSelf
constructor
A new instance of ModuleSelf.
Constructor Details
#initialize(tree, source) ⇒ ModuleSelf
Returns a new instance of ModuleSelf.
517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 |
# File 'lib/rbs/inline/ast/annotations.rb', line 517 def initialize(tree, source) @tree = tree @source = source module_self = tree.nth_tree!(1) type = module_self.nth_type?(1) case type when Types::ClassInstance, Types::Interface @constraint = RBS::AST::Declarations::Module::Self.new( name: type.name, args: type.args, location: nil ) end if comment = module_self.nth_tree(2) @comment = comment.to_s end end |
Instance Attribute Details
#comment ⇒ Object (readonly)
: String?
514 515 516 |
# File 'lib/rbs/inline/ast/annotations.rb', line 514 def comment @comment end |
#constraint ⇒ Object (readonly)
: RBS::AST::Declarations::Module::Self?
512 513 514 |
# File 'lib/rbs/inline/ast/annotations.rb', line 512 def constraint @constraint end |