Class: Statikaj::Render
Instance Attribute Summary collapse
-
#articles ⇒ Object
Returns the value of attribute articles.
-
#description ⇒ Object
Returns the value of attribute description.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
- #article {|_self| ... } ⇒ Object
-
#initialize(source, options) ⇒ Render
constructor
A new instance of Render.
- #page {|_self| ... } ⇒ Object
Constructor Details
#initialize(source, options) ⇒ Render
Returns a new instance of Render.
5 6 7 8 9 10 11 12 |
# File 'lib/statikaj/render.rb', line 5 def initialize(source, ) @source = source @article = .delete(:article) if [:article] @articles = .delete(:articles) if [:articles] if [:page] render_page(.delete(:page)) end end |
Instance Attribute Details
#articles ⇒ Object
Returns the value of attribute articles.
3 4 5 |
# File 'lib/statikaj/render.rb', line 3 def articles @articles end |
#description ⇒ Object
Returns the value of attribute description.
3 4 5 |
# File 'lib/statikaj/render.rb', line 3 def description @description end |
#title ⇒ Object
Returns the value of attribute title.
3 4 5 |
# File 'lib/statikaj/render.rb', line 3 def title @title end |
Instance Method Details
#article {|_self| ... } ⇒ Object
14 15 16 17 18 19 |
# File 'lib/statikaj/render.rb', line 14 def article(&blk) yield self to_html do @article.render(@source) end end |
#page {|_self| ... } ⇒ Object
21 22 23 24 25 26 |
# File 'lib/statikaj/render.rb', line 21 def page(&blk) yield self to_html do @page end end |