Class: Blogster::Templates
- Inherits:
-
Object
- Object
- Blogster::Templates
- Defined in:
- lib/blogster/templates.rb
Instance Attribute Summary collapse
-
#templates ⇒ Object
readonly
Returns the value of attribute templates.
Instance Method Summary collapse
- #[](page) ⇒ Object
- #[]=(page, page_templates = []) ⇒ Object
- #each(page, &block) ⇒ Object
-
#initialize(templates = {}) ⇒ Templates
constructor
A new instance of Templates.
- #pages ⇒ Object
Constructor Details
#initialize(templates = {}) ⇒ Templates
Returns a new instance of Templates.
5 6 7 |
# File 'lib/blogster/templates.rb', line 5 def initialize(templates = {}) @templates = templates end |
Instance Attribute Details
#templates ⇒ Object (readonly)
Returns the value of attribute templates.
3 4 5 |
# File 'lib/blogster/templates.rb', line 3 def templates @templates end |
Instance Method Details
#[](page) ⇒ Object
13 14 15 |
# File 'lib/blogster/templates.rb', line 13 def [](page) templates[page] end |
#[]=(page, page_templates = []) ⇒ Object
17 18 19 |
# File 'lib/blogster/templates.rb', line 17 def []=(page, page_templates = []) templates[page] = page_templates end |
#each(page, &block) ⇒ Object
9 10 11 |
# File 'lib/blogster/templates.rb', line 9 def each(page, &block) templates[page].each(&block) end |
#pages ⇒ Object
21 22 23 |
# File 'lib/blogster/templates.rb', line 21 def pages templates.keys end |