| Class | Array |
| In: |
yaml/rubytypes.rb
pp.rb mkmf.rb abbrev.rb |
| Parent: | Object |
Public Instance methods
Calculates the set of unambiguous abbreviations for the strings in self. If passed a pattern or a string, only the strings matching the pattern or starting with the string are considered.
%w{ car cone }.abbrev #=> { "ca" => "car", "car" => "car",
"co" => "cone", "con" => cone",
"cone" => "cone" }
# File abbrev.rb, line 90
90: def abbrev(pattern = nil)
91: Abbrev::abbrev(self, pattern)
92: end
18: def dclone 19: klone = self.clone 20: klone.clear 21: self.each{|v| klone << v.dclone} 22: klone 23: end
# File pp.rb, line 287
287: def pretty_print(q)
288: q.group(1, '[', ']') {
289: q.seplist(self) {|v|
290: q.pp v
291: }
292: }
293: end
# File yaml/rubytypes.rb, line 106
106: def to_yaml( opts = {} )
107: YAML::quick_emit( object_id, opts ) do |out|
108: out.seq( taguri, to_yaml_style ) do |seq|
109: each do |x|
110: seq.add( x )
111: end
112: end
113: end
114: end