Sha256: 2d23f84fdf8d1b29e299e0860c6e361495defb7efc00806940c24b19d19abad9

Contents?: true

Size: 365 Bytes

Versions: 15

Compression:

Stored size: 365 Bytes

Contents

# frozen_string_literal: true

module GoNative
  module Utils
    class TemplateInflator
      def initialize(content)
        @content = content.dup
      end
  
      def call(values)
        values.each { |name, value| content.gsub!("{{#{name}}}", value.to_s) }
    
        content
      end
  
      private
      
      attr_reader :content
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
gonative-cli-0.5.6 lib/gonative/utils/template_inflator.rb
gonative-cli-0.5.5 lib/gonative/utils/template_inflator.rb
gonative-cli-0.5.4 lib/gonative/utils/template_inflator.rb
gonative-cli-0.5.3 lib/gonative/utils/template_inflator.rb
gonative-cli-0.5.2 lib/gonative/utils/template_inflator.rb
gonative-cli-0.5.0 lib/gonative/utils/template_inflator.rb
gonative-cli-0.4.5 lib/gonative/utils/template_inflator.rb
gonative-cli-0.4.4 lib/gonative/utils/template_inflator.rb
gonative-cli-0.4.3 lib/gonative/utils/template_inflator.rb
gonative-cli-0.4.2 lib/gonative/utils/template_inflator.rb
gonative-cli-0.4.1 lib/gonative/utils/template_inflator.rb
gonative-cli-0.4.0 lib/gonative/utils/template_inflator.rb
gonative-cli-0.3.1 lib/gonative/utils/template_inflator.rb
gonative-cli-0.3.0 lib/gonative/utils/template_inflator.rb
gonative-cli-0.1.0 lib/gonative/utils/template_inflator.rb