Sha256: c53d319138886851b889126beb2689c4ab7eb2f44f76b17e9a715b4b0665bf71
Contents?: true
Size: 431 Bytes
Versions: 32
Compression:
Stored size: 431 Bytes
Contents
require 'json' module Spout module Helpers class JsonLoader def self.get_json(file_name, file_type) file = Dir.glob("#{file_type.to_s.downcase}s/**/#{file_name.to_s.downcase}.json", File::FNM_CASEFOLD).first json = JSON.parse(File.read(file)) rescue json = nil json end def self.get_variable(variable_name) get_json(variable_name, 'variable') end end end end
Version data entries
32 entries across 32 versions & 1 rubygems