class GDstruct
Constants
- VERSION
Public Class Methods
create a Ruby Hash/Array structure out of a GDS definition string
@param gds_definition [String] GDS definition @option config [true/false] :allow_env (false) allow the @env directive to access environment variables, otherwise the @env directive returns nil @option config [Binding] :context (nil) if a binding is set then the @r directive evaluates embedded ruby code, otherwise the @r directive returns nil
@return [Hash,Array] hash/array structure
@example
require 'gdstruct' h = GDstruct.c( <<-EOS ) a value 1 b value 2 EOS # => h = { a: 'value 1', b: 'value 2' }
# File lib/gdstruct.rb, line 29 def create( gds_definition, config = {} ) LDLgeneratedLanguage::Gds.parse( gds_definition, config ) end
create a Ruby Hash/Array structure out of a GDS definition file
@param file_name [String] file name @option config [true/false] :allow_env (false) allow the @env directive to access environment variables, otherwise the @env directive returns nil @option config [Binding] :context (nil) if a binding is set then the @r directive evaluates embedded ruby code, otherwise the @r directive returns nil
@return [Hash,Array] hash/array structure
# File lib/gdstruct.rb, line 41 def create_from_file( file_name, config = {} ) LDLgeneratedLanguage::Gds.parse( File.read( file_name ), config ) end