module JSON
Public Class Methods
read(path, opts = {})
click to toggle source
Parse JSON
data from a file at the given path.
TODO: Test this on [ruby 2.7]
@param path [String] @param opts [Hash] Options to pass to [`JSON.parse`]. @param (see parse) @return [Hash]
[1]: blog.saeloun.com/2019/10/07/ruby-2-7-keyword-arguments-redesign.html [2]: ruby-doc.org/stdlib-2.6.3/libdoc/json/rdoc/JSON.html#method-i-parse
# File lib/coolkit/json.rb, line 13 def self.read(path, opts = {}) return self.parse(File.read(path), opts) end