Class: Orthor::Category

Inherits:
Object
  • Object
show all
Includes:
Collections
Defined in:
lib/orthor/category.rb

Instance Attribute Summary

Attributes included from Collections

#categories, #feeds, #pages, #queries, #static_pages

Attributes inherited from Object

#path

Instance Method Summary collapse

Methods included from Collections

#category, #feed, #page, #query, #resources, #static_page

Methods inherited from Object

#content, #path_name

Methods included from HttpCaching

#cache_for

Constructor Details

#initialize(path, options = {}, &blk) ⇒ Category

Returns a new instance of Category.



7
8
9
10
11
12
13
# File 'lib/orthor/category.rb', line 7

def initialize(path, options = {}, &blk)
  @feeds, @categories, @pages, @static_pages, @queries = [], [], [], [], []
  super path, options

  # categories can give blocks
  instance_eval &blk if block_given?
end

Instance Method Details

#fetch_contentObject



15
16
17
# File 'lib/orthor/category.rb', line 15

def fetch_content
  Orthorings.category(@id, @template)
end

#titleObject



19
20
21
# File 'lib/orthor/category.rb', line 19

def title
  Orthorings.category(@id)["Title"]
end