module SXP

Public Class Methods

parse(input, **options)
Alias for: read
parse_all(input, **options)
Alias for: read_all
parse_file(filename, **options)
Alias for: read_file
parse_files(*filenames)
Alias for: read_files
parse_uri(url, **options)
Alias for: read_url
parse_url(url, **options)
Alias for: read_url
read(input, **options) click to toggle source

Reads one S-expression from the given input stream.

@param [IO, StringIO, String] input @param [Hash{Symbol => Object}] options @return [Object]

# File lib/sxp.rb, line 80
def self.read(input, **options)
  Reader::Basic.read(input, **options)
end
Also aliased as: parse
read_all(input, **options) click to toggle source

Reads all S-expressions from the given input stream.

@param [IO, StringIO, String] input @param [Hash{Symbol => Object}] options @return [Enumerable<Object>]

# File lib/sxp.rb, line 70
def self.read_all(input, **options)
  Reader::Basic.read_all(input, **options)
end
Also aliased as: parse_all
read_file(filename, **options) click to toggle source

Reads all S-expressions from a given input file.

@param [String, to_s] filename @param [Hash{Symbol => Object}] options @return [Enumerable<Object>]

# File lib/sxp.rb, line 60
def self.read_file(filename, **options)
  Reader::Basic.read_file(filename, **options)
end
Also aliased as: parse_file
read_files(*filenames) click to toggle source

Reads all S-expressions from the given input files.

@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>]

# File lib/sxp.rb, line 50
def self.read_files(*filenames)
  Reader::Basic.read_files(*filenames)
end
Also aliased as: parse_files
read_uri(url, **options)
Alias for: read_url
read_url(url, **options) click to toggle source

Reads all S-expressions from a given input URL using the HTTP or FTP protocols.

@param [String, to_s] url @param [Hash{Symbol => Object}] options @return [Enumerable<Object>]

# File lib/sxp.rb, line 35
def self.read_url(url, **options)
  Reader::Basic.read_url(url, **options)
end
Also aliased as: parse_url, parse_uri, read_uri
write(sxp, output = STDOUT) click to toggle source

Write an internal S-Expression as a formatted SXP

@param output

# File lib/sxp.rb, line 89
def self.write(sxp, output = STDOUT)
  Generator.write(output, sxp)
end