Sha256: ea1013d74c5a0ec983506541cff5045b25e7f647a08b2aabfb30ccd51616bedf

Contents?: true

Size: 1.12 KB

Versions: 1

Compression:

Stored size: 1.12 KB

Contents

# frozen_string_literal: true

#
# Copyright (c) 2019-present, Blue Marble Payroll, LLC
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
#

require 'acts_as_hashable'
require 'bigdecimal'
require 'forwardable'
require 'stringio'

# Monkey-patching core libaries
require_relative 'proforma/core_ext/hash'
Hash.include ::Proforma::CoreExt::Hash

require_relative 'proforma/compiling'
require_relative 'proforma/document'
require_relative 'proforma/hash_evaluator'
require_relative 'proforma/modeling'
require_relative 'proforma/plain_text_renderer'
require_relative 'proforma/prototype'
require_relative 'proforma/template'
require_relative 'proforma/type_factory'
require_relative 'proforma/model_factory'

# The top-level API that should be seen as the main entry point into this library.
module Proforma
  class << self
    def render(data, template, evaluator: HashEvaluator.new, renderer: PlainTextRenderer.new)
      Template.make(template)
              .compile(data, evaluator)
              .map { |prototype| renderer.render(prototype) }
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
proforma-1.0.0.pre.alpha lib/proforma.rb