Module: RBS::AST::Declarations::MixinHelper

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

Instance Method Summary collapse

Instance Method Details

#each_mixin(&block) ⇒ Object



131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# File 'lib/rbs/ast/declarations.rb', line 131

def each_mixin(&block)
  if block
    @mixins ||= begin
                  _ = members.select do |member|
                    case member
                    when Members::Include, Members::Extend, Members::Prepend
                      true
                    else
                      false
                    end
                  end
                end
    @mixins.each(&block)
  else
    enum_for :each_mixin
  end
end