Class: Randexp

Inherits:
Object
  • Object
show all
Defined in:
lib/randexp.rb,
lib/randexp/parser.rb,
lib/randexp/reducer.rb,
lib/randexp/version.rb

Defined Under Namespace

Classes: Dictionary, Parser, Reducer

Constant Summary collapse

VERSION =
"0.1.7"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(source) ⇒ Randexp

Returns a new instance of Randexp.



4
5
6
# File 'lib/randexp.rb', line 4

def initialize(source)
  @sexp = Randexp::Parser[source]
end

Instance Attribute Details

#sexpObject

Returns the value of attribute sexp.



2
3
4
# File 'lib/randexp.rb', line 2

def sexp
  @sexp
end

Instance Method Details

#reduceObject



8
9
10
# File 'lib/randexp.rb', line 8

def reduce
  Reducer[@sexp.dup]
end