Class: EhbrsRubyUtils::CookingBook::Build::BasePage
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- EhbrsRubyUtils::CookingBook::Build::BasePage
- Defined in:
- lib/ehbrs_ruby_utils/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.
11 12 13 14 |
# File 'lib/ehbrs_ruby_utils/cooking_book/build/base_page.rb', line 11 def initialize(parent, source_object) super(source_object) @parent = parent end |
Instance Attribute Details
#parent ⇒ Object (readonly)
Returns the value of attribute parent.
9 10 11 |
# File 'lib/ehbrs_ruby_utils/cooking_book/build/base_page.rb', line 9 def parent @parent end |
Instance Method Details
#build ⇒ Object
16 17 18 |
# File 'lib/ehbrs_ruby_utils/cooking_book/build/base_page.rb', line 16 def build target_path.write(target_content) end |
#erb_result(template_basename, template_source = self) ⇒ Object
36 37 38 |
# File 'lib/ehbrs_ruby_utils/cooking_book/build/base_page.rb', line 36 def erb_result(template_basename, template_source = self) template_source.erb_template("#{template_basename}.html.erb", self) end |
#href ⇒ Object
20 21 22 |
# File 'lib/ehbrs_ruby_utils/cooking_book/build/base_page.rb', line 20 def href "#{target_basename}.html" end |
#inner_content ⇒ Object
32 33 34 |
# File 'lib/ehbrs_ruby_utils/cooking_book/build/base_page.rb', line 32 def inner_content erb_result('inner', self.class) end |
#target_content ⇒ Object
28 29 30 |
# File 'lib/ehbrs_ruby_utils/cooking_book/build/base_page.rb', line 28 def target_content erb_result('layout', ::EhbrsRubyUtils::CookingBook::Build::BasePage) end |
#target_path ⇒ Object
24 25 26 |
# File 'lib/ehbrs_ruby_utils/cooking_book/build/base_page.rb', line 24 def target_path parent.target_dir.join(href) end |