module Wexpr

Ruby-Wexpr library

Currently does not handle Binary Wexpr.

Constants

VERSION

Public Class Methods

dump(variable, writeFlags=[]) click to toggle source

Emit a hash as the equivilant wexpr string, human readable or not. See possible writeflags in Expression. We also support :returnAsExpression which will return the expression, and not the string (for internal use).

# File lib/wexpr.rb, line 26
def self.dump(variable, writeFlags=[])
        # first step, go through the variable and create the equivilant wexpr expressions
        expr = Expression::create_from_ruby(variable)
        
        if writeFlags.include? :returnAsExpression
                return expr
        end
        
        # then have it write out the string
        return expr.create_string_representation(0, writeFlags)
end
load(str, flags=[]) click to toggle source

Parse Wexpr and turn it into a ruby hash Will thrown an Exception on failure

# File lib/wexpr.rb, line 17
def self.load(str, flags=[])
        expr = Expression::create_from_string(str, flags)
        return expr.to_ruby
end