Sha256: a9aebaf6e3b3d1e1d7a7f22751bea666dbd0a36f988e37b2a8de7fb544f0ac85

Contents?: true

Size: 373 Bytes

Versions: 6

Compression:

Stored size: 373 Bytes

Contents

# Copyright (c) 2009 Narihiro Nakamura <authornari@gmail.com>
require 'erb'

class HTMLLayout
  def initialize(src, title, template)
    @body = src
    @title = title
    @template = template
  end
  attr_reader :body, :title

  def result
    if File.exist?(@template)
      return ERB.new(IO.read(@template)).result(binding)
    else
      return @src
    end
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
review-1.2.0 lib/review/htmllayout.rb
review-1.1.0 lib/review/htmllayout.rb
tmtms-review-1.0.0 lib/review/htmllayout.rb
review-1.0.0 lib/review/htmllayout.rb
review-0.9.0 lib/review/htmllayout.rb
review-0.6.0 lib/review/htmllayout.rb