lib/picky/extensions/symbol.rb in picky-0.12.1 vs lib/picky/extensions/symbol.rb in picky-0.12.2
- old
+ new
@@ -1,24 +1,10 @@
# Extending the Symbol class.
#
class Symbol
- # :keys.subtokens # => [:keys, :key, :ke, :k]
- # :keys.subtokens(2) # => [:keys, :key, :ke]
- #
- def subtokens from_length = 1
- sub = self.id2name
-
- size = sub.size
- from_length = size + from_length if from_length < 0
- from_length = size if size < from_length
-
- result = [self]
- size.downto(from_length + 1) { result << sub.chop!.intern }
- result
- end
-
- # TODO Duplicate code.
+ # :keys.each_subtoken # => yields each of [:keys, :key, :ke, :k]
+ # :keys.each_subtoken(2) # => yields each of [:keys, :key, :ke]
#
def each_subtoken from_length = 1
sub = self.id2name
size = sub.size
\ No newline at end of file