Class: Spoom::RBS::Comments
- Inherits:
-
Object
- Object
- Spoom::RBS::Comments
- Defined in:
- lib/spoom/rbs.rb
Instance Attribute Summary collapse
-
#annotations ⇒ Object
readonly
: Array.
-
#signatures ⇒ Object
readonly
: Array.
Instance Method Summary collapse
-
#class_annotations ⇒ Object
: -> Array.
-
#empty? ⇒ Boolean
: -> bool.
-
#initialize ⇒ Comments
constructor
: -> void.
-
#method_annotations ⇒ Object
: -> Array.
Constructor Details
#initialize ⇒ Comments
: -> void
14 15 16 17 |
# File 'lib/spoom/rbs.rb', line 14 def initialize @annotations = [] #: Array[Annotation] @signatures = [] #: Array[Signature] end |
Instance Attribute Details
#annotations ⇒ Object (readonly)
: Array
8 9 10 |
# File 'lib/spoom/rbs.rb', line 8 def annotations @annotations end |
#signatures ⇒ Object (readonly)
: Array
11 12 13 |
# File 'lib/spoom/rbs.rb', line 11 def signatures @signatures end |
Instance Method Details
#class_annotations ⇒ Object
: -> Array
25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/spoom/rbs.rb', line 25 def class_annotations @annotations.select do |annotation| case annotation.string when "@abstract", "@interface", "@sealed", "@final" true when /^@requires_ancestor: / true else false end end end |
#empty? ⇒ Boolean
: -> bool
20 21 22 |
# File 'lib/spoom/rbs.rb', line 20 def empty? @annotations.empty? && @signatures.empty? end |
#method_annotations ⇒ Object
: -> Array
39 40 41 42 43 44 45 46 47 48 |
# File 'lib/spoom/rbs.rb', line 39 def method_annotations @annotations.select do |annotation| case annotation.string when "@abstract", "@final", "@override", "@override(allow_incompatible: true)", "@overridable", "@without_runtime" true else false end end end |