]>
Commit | Line | Data |
---|---|---|
b8498f5c BB |
1 | module Lyricli |
2 | module Util | |
3 | def camelize(str) | |
4 | str.split('_').map {|w| w.capitalize}.join | |
5 | end | |
6 | ||
7 | def parse_class(class_name) | |
d3e32008 BB |
8 | begin |
9 | path = "Sources::#{class_name}" | |
10 | return eval(path) | |
b8498f5c | 11 | rescue NameError |
d3e32008 BB |
12 | return nil |
13 | end | |
14 | end | |
15 | ||
16 | def sanitize_param(p) | |
17 | URI.encode_www_form_component(p.gsub(/ /, "+")).gsub("%2B", "+") | |
b8498f5c BB |
18 | end |
19 | end | |
20 | end |