Class | Hobix::BaseStorage |
In: |
lib/hobix/base.rb
|
Parent: | BasePlugin |
The BaseStorage class outlines the fundamental API for all storage plugins. Storage plugins are responsible for abstracting away entry queries and managing the loading of Entry objects. The goal being: cache as much as you can, be efficient and tidy.
find: | Each of the query methods below uses the find method to perform its search. This method accepts a Hash of parameters. Please note that calling find without parameters will return all entries which qualify for placement on the front page. |
all: | Returns all entries. Searches find( :all => true ) |
lastn: | Returns the last n entries which qualify for the front page. |
inpath: | Returns entries within a path which qualify for the front page. |
after: | Returns entries created after a given date. |
before: | Returns entries created before a given date. |
within: | Returns entries created between a start and end date. |
# File lib/hobix/base.rb, line 113 113: def after( after, n = nil ) 114: find( :after => after, :lastn => n ) 115: end
# File lib/hobix/base.rb, line 116 116: def before( before, n = nil ) 117: find( :before => before, :lastn => n ) 118: end
# File lib/hobix/base.rb, line 91 91: def default_entry( author ) 92: Hobix::Entry.new do |e| 93: e.id = default_entry_id 94: e.link = e.class.url_link e, @link, "html" 95: e.created = Time.now 96: e.modified = Time.now 97: e.updated = Time.now 98: e.title = "This Ghostly Message From the Slime Will Soon Vanish!" 99: e.tagline = "A temporary message, a tingling sensation, Hobix is up!!" 100: e.author = author 101: e.content = Hobix::Entry.text_processor.new( "Welcome to Hobix! Once you make your first blog post, this entry will disappear. However, in the meantime, you can tweak the CSS of your blog until it suits your satisfaction and you have this bit of words to act as a place holder." ) 102: end 103: end
# File lib/hobix/base.rb, line 110 110: def inpath( path, n = nil ) 111: find( :inpath => path, :lastn => n ) 112: end