Sha256: d7797ad57aa054736c4411c4138d3d654dacf9f3fbaea0e3fb22faab50a49d8a
Contents?: true
Size: 840 Bytes
Versions: 28
Compression:
Stored size: 840 Bytes
Contents
#================================================ # SCBI - dariogf <soporte@scbi.uma.es> #------------------------------------------------ # # Version: 0.1 - 04/2009 # # Usage: require "utils/json_utils" # # Fasta utilities # # # #================================================ module JsonUtils require 'json'; def to_pretty_json return JSON.pretty_generate(self) end def from_json return JSON.parse(self) end # =========================================== #------------------------------------ # get json data #------------------------------------ def self.get_json_data(file_path) file1 = File.open(file_path) text = file1.read file1.close # wipe text text=text.grep(/^\s*[^#]/).to_s # decode json data = JSON.parse(text) return data end end
Version data entries
28 entries across 28 versions & 1 rubygems