Module: SXP

Defined in:
vendor/bundler/ruby/2.7.0/bundler/gems/sxp.rb-25f5d813233a/lib/sxp.rb,
vendor/bundler/ruby/2.7.0/bundler/gems/sxp.rb-25f5d813233a/lib/sxp/list.rb,
vendor/bundler/ruby/2.7.0/bundler/gems/sxp.rb-25f5d813233a/lib/sxp/pair.rb,
vendor/bundler/ruby/2.7.0/bundler/gems/sxp.rb-25f5d813233a/lib/sxp/reader.rb,
vendor/bundler/ruby/2.7.0/bundler/gems/sxp.rb-25f5d813233a/lib/sxp/version.rb,
vendor/bundler/ruby/2.7.0/bundler/gems/sxp.rb-25f5d813233a/lib/sxp/generator.rb,
vendor/bundler/ruby/2.7.0/bundler/gems/sxp.rb-25f5d813233a/lib/sxp/reader/basic.rb,
vendor/bundler/ruby/2.7.0/bundler/gems/sxp.rb-25f5d813233a/lib/sxp/reader/scheme.rb,
vendor/bundler/ruby/2.7.0/bundler/gems/sxp.rb-25f5d813233a/lib/sxp/reader/sparql.rb,
vendor/bundler/ruby/2.7.0/bundler/gems/sxp.rb-25f5d813233a/lib/sxp/reader/extended.rb,
vendor/bundler/ruby/2.7.0/bundler/gems/sxp.rb-25f5d813233a/lib/sxp/reader/common_lisp.rb

Defined Under Namespace

Modules: VERSION Classes: Generator, List, Pair, Reader

Class Method Summary collapse

Class Method Details

.read(input, **options) ⇒ Object Also known as: parse

Reads one S-expression from the given input stream.

Parameters:

Returns:



66
67
68
# File 'vendor/bundler/ruby/2.7.0/bundler/gems/sxp.rb-25f5d813233a/lib/sxp.rb', line 66

def self.read(input, **options)
  Reader::Basic.read(input, **options)
end

.read_all(input, **options) ⇒ Enumerable<Object> Also known as: parse_all

Reads all S-expressions from the given input stream.

Parameters:

Returns:



56
57
58
# File 'vendor/bundler/ruby/2.7.0/bundler/gems/sxp.rb-25f5d813233a/lib/sxp.rb', line 56

def self.read_all(input, **options)
  Reader::Basic.read_all(input, **options)
end

.read_file(filename, **options) ⇒ Enumerable<Object> Also known as: parse_file

Reads all S-expressions from a given input file.

Parameters:

Returns:



46
47
48
# File 'vendor/bundler/ruby/2.7.0/bundler/gems/sxp.rb-25f5d813233a/lib/sxp.rb', line 46

def self.read_file(filename, **options)
  Reader::Basic.read_file(filename, **options)
end

.read_files(*filenames) ⇒ Enumerable<Object> .read_files(*filenames, **options) ⇒ Enumerable<Object> Also known as: parse_files

Reads all S-expressions from the given input files.

Overloads:

  • .read_files(*filenames) ⇒ Enumerable<Object>

    Parameters:

    • filenames (Enumerable<String>)
  • .read_files(*filenames, **options) ⇒ Enumerable<Object>

    Parameters:

Returns:



36
37
38
# File 'vendor/bundler/ruby/2.7.0/bundler/gems/sxp.rb-25f5d813233a/lib/sxp.rb', line 36

def self.read_files(*filenames)
  Reader::Basic.read_files(*filenames)
end

.read_url(url, **options) ⇒ Enumerable<Object> Also known as: parse_url, parse_uri, read_uri

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

Parameters:

Returns:



21
22
23
# File 'vendor/bundler/ruby/2.7.0/bundler/gems/sxp.rb-25f5d813233a/lib/sxp.rb', line 21

def self.read_url(url, **options)
  Reader::Basic.read_url(url, **options)
end

.write(sxp, output = STDOUT) ⇒ Object

Write an internal S-Expression as a formatted SXP

@param[Array] sxp @param[#write] output



75
76
77
# File 'vendor/bundler/ruby/2.7.0/bundler/gems/sxp.rb-25f5d813233a/lib/sxp.rb', line 75

def self.write(sxp, output = STDOUT)
  Generator.write(output, sxp)
end