Module: Oga::EntityDecoder
- Defined in:
- lib/oga/entity_decoder.rb
Class Method Summary collapse
Class Method Details
.decode(input, html = false) ⇒ String
11 12 13 14 15 |
# File 'lib/oga/entity_decoder.rb', line 11 def self.decode(input, html = false) decoder = html ? HTML::Entities : XML::Entities decoder.decode(input) end |
.try_decode(input, html = false) ⇒ Object
4 5 6 |
# File 'lib/oga/entity_decoder.rb', line 4 def self.try_decode(input, html = false) input ? decode(input, html) : nil end |