Sha256: 8835b3b099a1c94566c29878e702c3e32af6cb0c50bc6af50c86185a4597bb0f

Contents?: true

Size: 469 Bytes

Versions: 34

Compression:

Stored size: 469 Bytes

Contents

module Steep
  module AST
    module Types
      module Helper
        module ChildrenLevel
          def level_of_children(children)
            children.map(&:level).sort {|a, b| b.size <=> a.size }.inject() do |a, b|
              a.zip(b).map do |(x, y)|
                if x && y
                  x + y
                else
                  x || y
                end
              end
            end || []
          end
        end
      end
    end
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
steep-0.25.0 lib/steep/ast/types/helper.rb
steep-0.24.0 lib/steep/ast/types/helper.rb
steep-0.23.0 lib/steep/ast/types/helper.rb
steep-0.22.0 lib/steep/ast/types/helper.rb
steep-0.21.0 lib/steep/ast/types/helper.rb
steep-0.20.0 lib/steep/ast/types/helper.rb
steep-0.19.0 lib/steep/ast/types/helper.rb
steep-0.18.0 lib/steep/ast/types/helper.rb
steep-0.17.1 lib/steep/ast/types/helper.rb
steep-0.17.0 lib/steep/ast/types/helper.rb
steep-0.16.3 lib/steep/ast/types/helper.rb
steep-0.16.2 lib/steep/ast/types/helper.rb
steep-0.16.1 lib/steep/ast/types/helper.rb
steep-0.16.0 lib/steep/ast/types/helper.rb
steep-0.15.0 lib/steep/ast/types/helper.rb
steep-0.14.0 lib/steep/ast/types/helper.rb
steep-0.13.0 lib/steep/ast/types/helper.rb
steep-0.12.0 lib/steep/ast/types/helper.rb
steep-0.11.1 lib/steep/ast/types/helper.rb
steep-0.11.0 lib/steep/ast/types/helper.rb