Class: Zine::Page::FormattedData
- Inherits:
-
Object
- Object
- Zine::Page::FormattedData
- Includes:
- ERB::Util
- Defined in:
- lib/zine/page.rb
Overview
the meta data, passed formatted to the template
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#footer_partial ⇒ Object
Returns the value of attribute footer_partial.
-
#header_partial ⇒ Object
Returns the value of attribute header_partial.
-
#html ⇒ Object
Returns the value of attribute html.
-
#page ⇒ Object
readonly
Returns the value of attribute page.
-
#uri ⇒ Object
Returns the value of attribute uri.
Instance Method Summary collapse
-
#initialize(front_matter, site_opt) ⇒ FormattedData
constructor
A new instance of FormattedData.
- #public_binding ⇒ Object
Constructor Details
#initialize(front_matter, site_opt) ⇒ FormattedData
Returns a new instance of FormattedData.
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/zine/page.rb', line 30 def initialize(front_matter, site_opt) site = site_opt['options'] @page = { date_rfc3339: front_matter['date'], date_us: parse_date(front_matter['date']), github_name: site['github_name'], links_array: site_opt['links'], num_items_on_home: site['num_items_on_home'], site_author: site['site_author'], site_description: site['site_description'], site_name: site['site_name'], site_URL: site['site_URL'], tags: (front_matter['tags']), title: html_escape(front_matter['title']), twitter_name: site['twitter_name'], uri: '' } # uri only generated for posts, and not until after markdown, TO DO end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
23 24 25 |
# File 'lib/zine/page.rb', line 23 def data @data end |
#footer_partial ⇒ Object
Returns the value of attribute footer_partial.
24 25 26 |
# File 'lib/zine/page.rb', line 24 def @footer_partial end |
#header_partial ⇒ Object
Returns the value of attribute header_partial.
25 26 27 |
# File 'lib/zine/page.rb', line 25 def header_partial @header_partial end |
#html ⇒ Object
Returns the value of attribute html.
26 27 28 |
# File 'lib/zine/page.rb', line 26 def html @html end |
#page ⇒ Object (readonly)
Returns the value of attribute page.
27 28 29 |
# File 'lib/zine/page.rb', line 27 def page @page end |
#uri ⇒ Object
Returns the value of attribute uri.
28 29 30 |
# File 'lib/zine/page.rb', line 28 def uri @uri end |
Instance Method Details
#public_binding ⇒ Object
47 48 49 |
# File 'lib/zine/page.rb', line 47 def public_binding binding end |