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

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

Instance Method Summary collapse

Instance Method Details

#each_mixin(&block) ⇒ Object



110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# File 'lib/rbs/ast/declarations.rb', line 110

def each_mixin(&block)
  if block_given?
    @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