Method: Webby::Resources::DB#add
- Defined in:
- lib/webby/resources/db.rb
#add(page) ⇒ Object Also known as: <<
call-seq:
add( resource ) => resource
Add the given resource to the database. It will not be added a second time if it already exists in the database.
25 26 27 28 29 30 31 32 33 |
# File 'lib/webby/resources/db.rb', line 25 def add( page ) ary = @db[page.directory] # make sure we don't duplicate pages ary.delete page if ary.include? page ary << page page end |