lib/html2rss/utils.rb in html2rss-0.7.0 vs lib/html2rss/utils.rb in html2rss-0.8.0
- old
+ new
@@ -28,7 +28,13 @@
end
def self.hash_to_xml(hash)
hash.to_xml(skip_instruct: true, skip_types: true)
end
+
+ def self.get_class_from_name(snake_cased_name, module_name)
+ camel_cased_name = snake_cased_name.split('_').map(&:capitalize).join
+ class_name = ['Html2rss', module_name, camel_cased_name].join('::')
+ Object.const_get(class_name)
+ end
end
end