lib/sxp.rb in sxp-0.0.14 vs lib/sxp.rb in sxp-0.1.0

- old
+ new

@@ -37,12 +37,17 @@ end ## # Reads all S-expressions from the given input files. # - # @param [Enumerable<String>] filenames - # @param [Hash{Symbol => Object}] options + # @overload read_files(*filenames) + # @param [Enumerable<String>] filenames + # + # @overload read_files(*filenames, options) + # @param [Enumerable<String>] filenames + # @param [Hash{Symbol => Object}] options + # # @return [Enumerable<Object>] def self.read_files(*filenames) Reader::Scheme.read_files(*filenames) end @@ -72,9 +77,18 @@ # @param [IO, StringIO, String] input # @param [Hash{Symbol => Object}] options # @return [Object] def self.read(input, options = {}) Reader::Scheme.read(input, options) + end + + ## + # Write an internal S-Expression as a formatted SXP + # + # @param[Array<Object>] sxp + # @param[#write] output + def self.write(sxp, output = STDOUT) + Generator.write(output, sxp) end class << self alias_method :parse, :read alias_method :parse_all, :read_all