Module: Orthor::Collections

Included in:
Category, Site
Defined in:
lib/orthor/collections.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#categoriesObject

Returns the value of attribute categories.



3
4
5
# File 'lib/orthor/collections.rb', line 3

def categories
  @categories
end

#feedsObject

Returns the value of attribute feeds.



3
4
5
# File 'lib/orthor/collections.rb', line 3

def feeds
  @feeds
end

#pagesObject

Returns the value of attribute pages.



3
4
5
# File 'lib/orthor/collections.rb', line 3

def pages
  @pages
end

#queriesObject

Returns the value of attribute queries.



3
4
5
# File 'lib/orthor/collections.rb', line 3

def queries
  @queries
end

#static_pagesObject

Returns the value of attribute static_pages.



3
4
5
# File 'lib/orthor/collections.rb', line 3

def static_pages
  @static_pages
end

Instance Method Details

#category(path, options = {}, &block) ⇒ Object



9
10
11
# File 'lib/orthor/collections.rb', line 9

def category(path, options = {}, &block)
  categories << Orthor::Category.new(path, options, &block)
end

#feed(path, options = {}, &block) ⇒ Object



17
18
19
# File 'lib/orthor/collections.rb', line 17

def feed(path, options = {}, &block)
  feeds << Orthor::Feed.new(path, options, &block)
end

#page(path, options = {}, &block) ⇒ Object



5
6
7
# File 'lib/orthor/collections.rb', line 5

def page(path, options = {}, &block)
  pages << Orthor::Page.new(path, options, &block)
end

#query(path, options = {}, &block) ⇒ Object



13
14
15
# File 'lib/orthor/collections.rb', line 13

def query(path, options = {}, &block)
  queries << Orthor::Query.new(path, options, &block)
end

#resourcesObject



25
26
27
28
# File 'lib/orthor/collections.rb', line 25

def resources
  return [] unless @feeds && @pages && @static_pages && @categories && @queries
  ((@feeds + @pages + @static_pages + @categories + @queries) + @categories.collect { |category| category.resources }).flatten
end

#static_page(path, options = {}, &block) ⇒ Object



21
22
23
# File 'lib/orthor/collections.rb', line 21

def static_page(path, options = {}, &block)
  static_pages << Orthor::StaticPage.new(path, options, &block)
end