Sha256: 74dd0f75a25982f24d03796c42bc4d9ffd7d51dc819bfbe52b9d125a73e22c3e
Contents?: true
Size: 565 Bytes
Versions: 28
Compression:
Stored size: 565 Bytes
Contents
module Onebox module Helpers def self.symbolize_keys(hash) return {} if hash.nil? hash.inject({}){|result, (key, value)| new_key = case key when String then key.to_sym else key end new_value = case value when Hash then symbolize_keys(value) else value end result[new_key] = new_value result } end def self.clean(html) html.gsub(/<[^>]+>/, ' ').gsub(/\n/, '') end end end
Version data entries
28 entries across 28 versions & 1 rubygems