Sha256: a7bad071cc22a400132e9f2bec0bf938c25acfde3f047a28f7b641ad72c180f1

Contents?: true

Size: 729 Bytes

Versions: 4

Compression:

Stored size: 729 Bytes

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.
#

module Proforma
  module Modeling
    # Emit and render basic text against a record.
    class Text
      include Compiling::Compilable
      extend Forwardable
      acts_as_hashable

      def_delegator :value, :empty?, :empty?

      attr_writer :value

      def initialize(value: '')
        @value = value
      end

      def value
        @value.to_s
      end

      def compile(data, evaluator)
        self.class.new(
          value: evaluator.text(data, value)
        )
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
proforma-1.0.2 lib/proforma/modeling/text.rb
proforma-1.0.1 lib/proforma/modeling/text.rb
proforma-1.0.0 lib/proforma/modeling/text.rb
proforma-1.0.0.pre.alpha lib/proforma/modeling/text.rb