Sha256: 2c321cefe7cebc022ee0c75d1c5607eeef0a9b70fa8eeec6592d7726475e0487

Contents?: true

Size: 853 Bytes

Versions: 63

Compression:

Stored size: 853 Bytes

Contents

%a{annotate:rdoc:skip}
class Array[unchecked out Elem]
  # <!--
  #   rdoc-file=lib/abbrev.rb
  #   - abbrev(pattern = nil)
  # -->
  # Calculates the set of unambiguous abbreviations for the strings in `self`.
  #
  #     require 'abbrev'
  #     %w{ car cone }.abbrev
  #     #=> {"car"=>"car", "ca"=>"car", "cone"=>"cone", "con"=>"cone", "co"=>"cone"}
  #
  # The optional `pattern` parameter is a pattern or a string. Only input strings
  # that match the pattern or start with the string are included in the output
  # hash.
  #
  #     %w{ fast boat day }.abbrev(/^.a/)
  #     #=> {"fast"=>"fast", "fas"=>"fast", "fa"=>"fast", "day"=>"day", "da"=>"day"}
  #
  #     Abbrev.abbrev(%w{car box cone}, "ca")
  #     #=> {"car"=>"car", "ca"=>"car"}
  #
  # See also Abbrev.abbrev
  #
  def abbrev: (?String | Regexp | nil) -> Hash[String, String]
end

Version data entries

63 entries across 63 versions & 2 rubygems

Version Path
rbs-3.7.0.dev.1 stdlib/abbrev/0/array.rbs
rbs-3.6.1 stdlib/abbrev/0/array.rbs
rbs-3.6.0 stdlib/abbrev/0/array.rbs
rbs-3.6.0.pre.3 stdlib/abbrev/0/array.rbs
rbs-3.6.0.pre.2 stdlib/abbrev/0/array.rbs
rbs-3.6.0.pre.1 stdlib/abbrev/0/array.rbs
rbs-3.6.0.dev.1 stdlib/abbrev/0/array.rbs
rbs-3.5.3 stdlib/abbrev/0/array.rbs
rbs-3.5.2 stdlib/abbrev/0/array.rbs
rbs-3.5.1 stdlib/abbrev/0/array.rbs
rbs-3.5.1.pre.1 stdlib/abbrev/0/array.rbs
rbs-3.5.0 stdlib/abbrev/0/array.rbs
rbs-3.5.0.pre.2 stdlib/abbrev/0/array.rbs
rbs-3.5.0.pre.1 stdlib/abbrev/0/array.rbs
rbs-3.4.4 stdlib/abbrev/0/array.rbs
rbs-3.4.3 stdlib/abbrev/0/array.rbs
rbs-3.4.2 stdlib/abbrev/0/array.rbs
getargv-0.3.3-universal-darwin vendor/bundle/ruby/3.3.0/gems/rbs-2.8.4/stdlib/abbrev/0/array.rbs
rbs-3.4.1 stdlib/abbrev/0/array.rbs
rbs-3.4.0 stdlib/abbrev/0/array.rbs