Class: HTMLLayout
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
-
#initialize(src, title, template) ⇒ HTMLLayout
constructor
A new instance of HTMLLayout.
- #result ⇒ Object
Constructor Details
#initialize(src, title, template) ⇒ HTMLLayout
Returns a new instance of HTMLLayout.
5 6 7 8 9 |
# File 'lib/review/htmllayout.rb', line 5 def initialize(src, title, template) @body = src @title = title @template = template end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
10 11 12 |
# File 'lib/review/htmllayout.rb', line 10 def body @body end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
10 11 12 |
# File 'lib/review/htmllayout.rb', line 10 def title @title end |
Instance Method Details
#result ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/review/htmllayout.rb', line 12 def result if File.exist?(@template) return ERB.new(IO.read(@template)).result(binding) else return @src end end |