class Estratto::Encoder
Attributes
content[R]
Public Class Methods
new(content)
click to toggle source
# File lib/estratto/encoder.rb, line 7 def initialize(content) @content = content end
Public Instance Methods
encode()
click to toggle source
# File lib/estratto/encoder.rb, line 11 def encode CharlockHolmes::Converter.convert(content, encoding, 'UTF-8') end
Private Instance Methods
encoding()
click to toggle source
# File lib/estratto/encoder.rb, line 17 def encoding CharlockHolmes::EncodingDetector.detect(content)[:encoding] end