Sha256: 78025fd2d9a30c211ed666f7d8a2a2348fd05c15e757733faf70ec88934fef61

Contents?: true

Size: 355 Bytes

Versions: 6

Compression:

Stored size: 355 Bytes

Contents

# frozen_string_literal: true

module Mako
  class Writer
    attr_reader :renderer, :destination

    def initialize(args)
      @renderer = args.fetch(:renderer)
      @destination = args.fetch(:destination)
    end

    def write
      File.open(destination, 'w+', encoding: 'utf-8') do |f|
        f.write(renderer.render)
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
mako_rss-0.2.5 lib/mako/writer.rb
mako_rss-0.2.3 lib/mako/writer.rb
mako_rss-0.2.2 lib/mako/writer.rb
mako_rss-0.2.1 lib/mako/writer.rb
mako_rss-0.2.0 lib/mako/writer.rb
mako_rss-0.1.0 lib/mako/writer.rb