Class: Humanized::CompilerBase
Direct Known Subclasses
Instance Method Summary collapse
-
#compile(str) ⇒ Compiled
Compiles a String into a Proc.
-
#initialize ⇒ CompilerBase
constructor
A new instance of CompilerBase.
Constructor Details
#initialize ⇒ CompilerBase
Returns a new instance of CompilerBase.
38 39 40 |
# File 'lib/humanized/compiler.rb', line 38 def initialize @compiled = Hash.new{|hsh,x| hsh[x] = compile!(x)} end |
Instance Method Details
#compile(str) ⇒ Compiled
Compiles a String into a Proc
47 48 49 |
# File 'lib/humanized/compiler.rb', line 47 def compile(str) @compiled[str] end |