Module: RBS::AST::Declarations::NestedDeclarationHelper

Included in:
Class, Module
Defined in:
lib/rbs/ast/declarations.rb

Instance Method Summary collapse

Instance Method Details

#each_declObject



96
97
98
99
100
101
102
103
104
105
106
# File 'lib/rbs/ast/declarations.rb', line 96

def each_decl
  if block_given?
    members.each do |member|
      if member.is_a?(Declarations::Base)
        yield member
      end
    end
  else
    enum_for :each_decl
  end
end

#each_memberObject



84
85
86
87
88
89
90
91
92
93
94
# File 'lib/rbs/ast/declarations.rb', line 84

def each_member
  if block_given?
    members.each do |member|
      if member.is_a?(Members::Base)
        yield member
      end
    end
  else
    enum_for :each_member
  end
end