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



117
118
119
120
121
122
123
124
125
126
127
# File 'lib/rbs/ast/declarations.rb', line 117

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



105
106
107
108
109
110
111
112
113
114
115
# File 'lib/rbs/ast/declarations.rb', line 105

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