Class: Blogster::Templates

Inherits:
Object
  • Object
show all
Defined in:
lib/blogster/templates.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#templatesObject (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

#pagesObject



21
22
23
# File 'lib/blogster/templates.rb', line 21

def pages
  templates.keys
end