Module: Transit::Definition::Page::ClassMethods

Defined in:
lib/transit/definitions/page.rb

Overview

Class level methods and functionality

Instance Method Summary collapse

Instance Method Details

#from_path(path) ⇒ Object

Accepts a url fragment and returns the corresponding page.



73
74
75
# File 'lib/transit/definitions/page.rb', line 73

def from_path(path)
  where(path: path.split("/"))
end

#publishedObject

Returns all published pages



80
81
82
# File 'lib/transit/definitions/page.rb', line 80

def published
  where(:published => true)
end

#top_levelObject

Returns all top_level pages (those without children)



65
66
67
# File 'lib/transit/definitions/page.rb', line 65

def top_level
  roots
end