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



22
23
24
25
26
27
28
29
30
31
32
# File 'lib/rbs/ast/declarations.rb', line 22

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

#each_memberObject



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/rbs/ast/declarations.rb', line 10

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