Module: Elparser

Defined in:
lib/elparser.rb,
lib/elparser/version.rb,
lib/elparser/parser.tab.rb

Defined Under Namespace

Classes: AbstractSExp, AbstractSExpAtom, AbstractSExpCons, EncodingError, Parser, ParserError, SExpCons, SExpList, SExpListDot, SExpNil, SExpNumber, SExpQuoted, SExpString, SExpSymbol

Constant Summary collapse

VERSION =
"0.0.7"

Class Method Summary collapse

Class Method Details

.encode(obj) ⇒ Object

Translate a ruby object to s-expression string.



316
317
318
# File 'lib/elparser.rb', line 316

def self.encode(obj)
  return _encode(obj).to_s
end

.encode_multi(objs, sep = "\n") ⇒ Object

Translate many ruby objects to s-expression string. The result s-exps are concatenated into one string.



322
323
324
# File 'lib/elparser.rb', line 322

def self.encode_multi(objs, sep = "\n")
  return objs.map {|obj| _encode(obj).to_s }.join(sep)
end