Class: UltimateLyrics::Provider::UrlFormat
- Inherits:
-
Object
- Object
- UltimateLyrics::Provider::UrlFormat
- Defined in:
- lib/ultimate_lyrics/provider/url_format.rb
Instance Method Summary collapse
Instance Method Details
#apply(value) ⇒ Object
8 9 10 |
# File 'lib/ultimate_lyrics/provider/url_format.rb', line 8 def apply(value) replace_chars.inject(value) { |a, e| a.gsub(e, with) } end |
#replace_chars ⇒ Object
12 13 14 |
# File 'lib/ultimate_lyrics/provider/url_format.rb', line 12 def replace_chars ::CGI.unescapeHTML(node.attribute('replace').text).each_char.to_a end |
#with ⇒ Object
16 17 18 |
# File 'lib/ultimate_lyrics/provider/url_format.rb', line 16 def with node.attribute('with').text end |