Method: Zold::JsonPage#to_hash
- Defined in:
- lib/zold/json_page.rb
#to_hash ⇒ Object
39 40 41 42 43 44 |
# File 'lib/zold/json_page.rb', line 39 def to_hash raise 'JSON is empty, can\'t parse' + (@uri.empty? ? '' : " at #{@uri}") if @text.empty? JSON.parse(@text) rescue JSON::ParserError => e raise "Failed to parse JSON #{@uri.empty? ? '' : "at #{@uri}"} (#{e.}): #{@text}" end |