Sha256: 45f3de066c48b0879807e6cd1c4483269fd1d5ee20e36e917d074a9478b6fc30
Contents?: true
Size: 609 Bytes
Versions: 18
Compression:
Stored size: 609 Bytes
Contents
require 'json' require_relative '../schema' # :nodoc: module Prmd # Schema generator class Generator # # @param [Hash<Symbol, Object>] properties def initialize(properties = {}) @properties = properties @base = properties.fetch(:base, {}) @template = properties.fetch(:template) end # # @param [Hash<Symbol, Object>] options def generate(options = {}) res = @template.result(options) resource_schema = JSON.parse(res) schema = Prmd::Schema.new schema.merge!(@base) schema.merge!(resource_schema) schema end end end
Version data entries
18 entries across 18 versions & 1 rubygems