Class: DmozSax::NameParser

Inherits:
Object
  • Object
show all
Defined in:
lib/dmoz_sax/name_parser.rb

Instance Method Summary collapse

Instance Method Details

#level_from(name) ⇒ Object



3
4
5
6
# File 'lib/dmoz_sax/name_parser.rb', line 3

def level_from name
  match = name.to_s.match(/^([A-Za-z_-]+)([\d]+)?$/)
  match[2].to_i
end