Sha256: 5c6aecef73c356acba631eb6c53443874c8374c928b11acb3ed8003c0b18e485
Contents?: true
Size: 1.14 KB
Versions: 25
Compression:
Stored size: 1.14 KB
Contents
# encoding: UTF-8 # # Copyright (c) 2010-2017 GoodData Corporation. All rights reserved. # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. require 'json' require_relative 'params_dsl' require_relative 'type_dsl' require_relative '../../helpers/global_helpers' module GoodData module LCM2 module Dsl module Dsl DEFAULT_OPTS = { required: false, default: nil } PARAMS = {} TYPES = {} def process(_klass, type, _caption, &block) dsl = type.new dsl.instance_eval(&block) # puts "#{caption}: #{klass.name}" # puts JSON.pretty_generate(dsl.params) # puts # yield if block_given? # Return params dsl.params end def define_params(klass, &block) PARAMS[klass] = process(klass, GoodData::LCM2::Dsl::ParamsDsl, 'PARAMS', &block) end def define_type(klass, &block) TYPES[klass] = process(klass, GoodData::LCM2::Dsl::TypeDsl, 'TYPE', &block) end end end end end
Version data entries
25 entries across 25 versions & 1 rubygems