Sha256: 953d7822d582cdbb0b41654d3d5094c93351a726beb2573f91d5ea3c219b0f93

Contents?: true

Size: 257 Bytes

Versions: 7

Compression:

Stored size: 257 Bytes

Contents

module FaaStRuby
  class Template
    def initialize(variables: {})
      variables.each do |var, value|
        instance_variable_set("@#{var}", value)
      end
    end

    def render(file)
      ERB.new(File.read(file)).result(binding)
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
faastruby-0.5.30 lib/faastruby/server/template.rb
faastruby-0.5.29 lib/faastruby/server/template.rb
faastruby-0.5.28 lib/faastruby/server/template.rb
faastruby-0.5.27 lib/faastruby/server/template.rb
faastruby-0.5.26 lib/faastruby/server/template.rb
faastruby-0.5.25 lib/faastruby/server/template.rb
faastruby-0.5.24 lib/faastruby/server/template.rb