Sha256: 0c22c8aaf2cdf6923399db173546f1f318c58db4d36bfd8a6761e221a05decc8

Contents?: true

Size: 240 Bytes

Versions: 29

Compression:

Stored size: 240 Bytes

Contents

# frozen_string_literal: true
module StringExtensions
  refine String do
    def json_to_hash
      ::JSON.parse(self)
    rescue ::JSON::ParserError
      # logger.error "##{__method__} => Unable to parse JSON response."
    end
  end
end

Version data entries

29 entries across 29 versions & 2 rubygems

Version Path
finapps-2.1.3 lib/core_extensions/string/json_to_hash.rb
finapps-2.1.2 lib/core_extensions/string/json_to_hash.rb
finapps-2.1.1 lib/core_extensions/string/json_to_hash.rb
finapps-2.0.30 lib/core_extensions/string/json_to_hash.rb
finapps-2.0.29 lib/core_extensions/string/json_to_hash.rb
finapps-2.0.28 lib/core_extensions/string/json_to_hash.rb
finapps-2.0.27 lib/core_extensions/string/json_to_hash.rb
finapps-2.0.26 lib/core_extensions/string/json_to_hash.rb
finapps-2.0.25 lib/core_extensions/string/json_to_hash.rb