Module: RBS::Inline::AST::Declarations::DataStructUtil
- Included in:
- DataAssignDecl, StructAssignDecl
- Defined in:
- lib/rbs/inline/ast/declarations.rb
Instance Method Summary collapse
Instance Method Details
#class_annotations ⇒ Object
: Array
311 312 313 314 315 316 317 318 319 320 321 |
# File 'lib/rbs/inline/ast/declarations.rb', line 311 def class_annotations #: Array[RBS::AST::Annotation] annotations = [] #: Array[RBS::AST::Annotation] comments&.each_annotation do |annotation| if annotation.is_a?(Annotations::RBSAnnotation) annotations.concat annotation.annotations end end annotations end |
#each_attribute(&block) ⇒ Object
296 297 298 299 300 301 302 303 304 305 306 307 308 309 |
# File 'lib/rbs/inline/ast/declarations.rb', line 296 def each_attribute(&block) if block each_attribute_argument do |arg| if arg.is_a?(Prism::SymbolNode) if name = arg.value type = type_decls.fetch(arg.location.start_line, nil) yield [name.to_sym, type] end end end else enum_for :each_attribute end end |