Class: Songbirdsh::RangeExpander
- Inherits:
-
Object
- Object
- Songbirdsh::RangeExpander
- Defined in:
- lib/songbirdsh/range_expander.rb
Instance Method Summary collapse
Instance Method Details
#expand(text) ⇒ Object
3 4 5 |
# File 'lib/songbirdsh/range_expander.rb', line 3 def text text.split(/[^0-9a-z-]/).inject([]) {|acc, term| acc + (term) } end |
#expand_to_ids(text) ⇒ Object
7 8 9 |
# File 'lib/songbirdsh/range_expander.rb', line 7 def text (text).map {|number| from_number number } end |