diff options
author | Philip Arndt <parndt@gmail.com> | 2011-05-31 14:16:04 +1200 |
---|---|---|
committer | Philip Arndt <parndt@gmail.com> | 2011-05-31 14:16:04 +1200 |
commit | 2dc08f3a496af8ddf8bdbb760b551494ffdefeb2 (patch) | |
tree | 3c8f343917573cf40580a3eb242e10953b20df9e /lib/refinery/blog/tabs.rb | |
parent | 60fc7839f8b6227951eed454442b69836840df01 (diff) | |
download | refinerycms-blog-2dc08f3a496af8ddf8bdbb760b551494ffdefeb2.tar.gz refinerycms-blog-2dc08f3a496af8ddf8bdbb760b551494ffdefeb2.tar.bz2 refinerycms-blog-2dc08f3a496af8ddf8bdbb760b551494ffdefeb2.zip |
tab -> tabs and requiring the file on to_prepare so that it actually loads. Fixed specs now that the form 'looks' different.
Diffstat (limited to 'lib/refinery/blog/tabs.rb')
-rw-r--r-- | lib/refinery/blog/tabs.rb | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/lib/refinery/blog/tabs.rb b/lib/refinery/blog/tabs.rb new file mode 100644 index 0000000..083d50b --- /dev/null +++ b/lib/refinery/blog/tabs.rb @@ -0,0 +1,28 @@ +module Refinery + module Blog + attr_accessor :tabs + + def self.tabs + @tabs ||= [] + end + + class Tab + attr_accessor :name, :partial + + def self.register(&block) + tab = self.new + + yield tab + + raise "A tab MUST have a name!: #{tab.inspect}" if tab.name.blank? + raise "A tab MUST have a partial!: #{tab.inspect}" if tab.partial.blank? + end + + protected + + def initialize + ::Refinery::Blog.tabs << self # add me to the collection of registered page tabs + end + end + end +end
\ No newline at end of file |