class SaltParser::Builder

Attributes

body[R]
content[R]
headers[R]
parser[R]

Private Instance Methods

convert_to_utf8(string) click to toggle source
# File lib/salt-parser/builder.rb, line 17
def convert_to_utf8(string)
  return string if Kconv.isutf8(string)
  string.encode(Encoding::UTF_8.to_s, Encoding::ISO_8859_1.to_s)
rescue Exception
  raise SaltParser::Error::InvalidEncoding
end
open_resource(resource) click to toggle source
# File lib/salt-parser/builder.rb, line 7
def open_resource(resource)
  if resource.respond_to?(:read)
    resource
  else
    open(resource)
  end
rescue Exception
  StringIO.new(resource)
end