Sha256: 677a57ea0f5182b984a6f668e1c094f91909b221168f74c6ca193b3f8f47ca20

Contents?: true

Size: 1.01 KB

Versions: 1

Compression:

Stored size: 1.01 KB

Contents

# frozen_string_literal: true

# File: static-text.rb


module Macros4Cuke # Module used as a namespace
  # Module containing all classes implementing the simple template engine
  # used internally in Macros4Cuke.
  module Templating
    # Class used internally by the template engine.
    # Represents a static piece of text from a template.
    # A static text is a text that is reproduced verbatim
    # when rendering a template.
    class StaticText
      # The static text extracted from the original template.
      attr_reader(:source)


      # @param aSourceText [String] A piece of text extracted
      #   from the template that must be rendered verbatim.
      def initialize(aSourceText)
        @source = aSourceText
      end

      # Render the static text.
      # This method has the same signature as the {Engine#render} method.
      # @return [String] Static text is returned verbatim ("as is")
      def render(_, _)
        return source
      end
    end # class
  end # module
end # module

# End of file

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
macros4cuke-0.5.17 lib/macros4cuke/templating/static-text.rb