Class: Ehbrs::CookingBook::Build::BasePage
- Defined in:
- lib/ehbrs/cooking_book/build/base_page.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#parent ⇒ Object
readonly
Returns the value of attribute parent.
Instance Method Summary collapse
- #build ⇒ Object
- #erb_result(template_basename, template_source = self) ⇒ Object
- #href ⇒ Object
-
#initialize(parent, source_object) ⇒ BasePage
constructor
A new instance of BasePage.
- #inner_content ⇒ Object
- #target_content ⇒ Object
- #target_path ⇒ Object
Constructor Details
#initialize(parent, source_object) ⇒ BasePage
Returns a new instance of BasePage.
12 13 14 15 |
# File 'lib/ehbrs/cooking_book/build/base_page.rb', line 12 def initialize(parent, source_object) super(source_object) @parent = parent end |
Instance Attribute Details
#parent ⇒ Object (readonly)
Returns the value of attribute parent.
10 11 12 |
# File 'lib/ehbrs/cooking_book/build/base_page.rb', line 10 def parent @parent end |
Instance Method Details
#build ⇒ Object
17 18 19 |
# File 'lib/ehbrs/cooking_book/build/base_page.rb', line 17 def build target_path.write(target_content) end |
#erb_result(template_basename, template_source = self) ⇒ Object
37 38 39 |
# File 'lib/ehbrs/cooking_book/build/base_page.rb', line 37 def erb_result(template_basename, template_source = self) template_source.erb_template("#{template_basename}.html.erb", self) end |
#href ⇒ Object
21 22 23 |
# File 'lib/ehbrs/cooking_book/build/base_page.rb', line 21 def href "#{target_basename}.html" end |
#inner_content ⇒ Object
33 34 35 |
# File 'lib/ehbrs/cooking_book/build/base_page.rb', line 33 def inner_content erb_result('inner', self.class) end |
#target_content ⇒ Object
29 30 31 |
# File 'lib/ehbrs/cooking_book/build/base_page.rb', line 29 def target_content erb_result('layout', ::Ehbrs::CookingBook::Build::BasePage) end |
#target_path ⇒ Object
25 26 27 |
# File 'lib/ehbrs/cooking_book/build/base_page.rb', line 25 def target_path parent.target_dir.join(href) end |