diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/static_page.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/static_page.rb b/lib/static_page.rb index 679e799..1c5336e 100644 --- a/lib/static_page.rb +++ b/lib/static_page.rb @@ -36,6 +36,10 @@ class StaticPage attr_accessor :path, :children, :name, :props, :parent + ## + ## CLASS METHODS + ## + def self.find(filter) if filter =~ /\// path = filter.split('/').map{|segment| segment.gsub(/[^0-9a-z_-]/, '')} @@ -66,6 +70,10 @@ class StaticPage end end + ## + ## INSTANCE METHODS + ## + def initialize(parent, name) @children = [] @name = name @@ -113,6 +121,10 @@ class StaticPage end end + def id + self.name + end + protected def child_tree |