Sha256: 8b0ba0c5ec846eab2ada3dded96e93225eff6d2e32e600ec19ff4683884475ad

Contents?: true

Size: 235 Bytes

Versions: 227

Compression:

Stored size: 235 Bytes

Contents

# frozen_string_literal: true

require 'pathname'

class Pathname
  # Apply .parent n times.
  # @return [Pathname]
  def parent_n(n) # rubocop:disable Naming/MethodParameterName
    n.times.inject(self) { |a, _e| a.parent }
  end
end

Version data entries

227 entries across 227 versions & 4 rubygems

Version Path
eac_tools-0.70.0 sub/eac_ruby_utils/lib/eac_ruby_utils/patches/pathname/parent_n.rb
eac_tools-0.69.1 sub/eac_ruby_utils/lib/eac_ruby_utils/patches/pathname/parent_n.rb
eac_ruby_utils-0.117.1 lib/eac_ruby_utils/patches/pathname/parent_n.rb
eac_tools-0.69.0 sub/eac_ruby_utils/lib/eac_ruby_utils/patches/pathname/parent_n.rb
eac_tools-0.68.0 sub/eac_ruby_utils/lib/eac_ruby_utils/patches/pathname/parent_n.rb
eac_tools-0.67.1 sub/eac_ruby_utils/lib/eac_ruby_utils/patches/pathname/parent_n.rb
eac_ruby_utils-0.117.0 lib/eac_ruby_utils/patches/pathname/parent_n.rb
eac_tools-0.67.0 sub/eac_ruby_utils/lib/eac_ruby_utils/patches/pathname/parent_n.rb
eac_tools-0.66.0 sub/eac_ruby_utils/lib/eac_ruby_utils/patches/pathname/parent_n.rb
eac_tools-0.65.1 sub/eac_ruby_utils/lib/eac_ruby_utils/patches/pathname/parent_n.rb
eac_ruby_utils-0.116.0 lib/eac_ruby_utils/patches/pathname/parent_n.rb
eac_ruby_utils-0.115.0 lib/eac_ruby_utils/patches/pathname/parent_n.rb
eac_tools-0.65.0 sub/eac_ruby_utils/lib/eac_ruby_utils/patches/pathname/parent_n.rb
eac_ruby_utils-0.114.0 lib/eac_ruby_utils/patches/pathname/parent_n.rb
eac_tools-0.64.0 sub/eac_ruby_utils/lib/eac_ruby_utils/patches/pathname/parent_n.rb
eac_ruby_utils-0.113.0 lib/eac_ruby_utils/patches/pathname/parent_n.rb
eac_tools-0.63.0 sub/eac_ruby_utils/lib/eac_ruby_utils/patches/pathname/parent_n.rb
eac_tools-0.62.1 sub/eac_ruby_utils/lib/eac_ruby_utils/patches/pathname/parent_n.rb
eac_tools-0.62.0 sub/eac_ruby_utils/lib/eac_ruby_utils/patches/pathname/parent_n.rb
eac_tools-0.61.1 sub/eac_ruby_utils/lib/eac_ruby_utils/patches/pathname/parent_n.rb