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

- (Object) from_path(path)

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

- (Object) published

Returns all published pages



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

def published
  where(:published => true)
end

- (Object) top_level

Returns all top_level pages (those without children)



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

def top_level
  roots
end