class Refinery::Pages::Tab

Attributes

name[RW]
partial[RW]
templates[RW]

Public Class Methods

new() click to toggle source
# File lib/refinery/pages/tab.rb, line 35
def initialize
  Refinery::Pages.tabs << self # add me to the collection of registered page tabs
end
register() { |tab| ... } click to toggle source
# File lib/refinery/pages/tab.rb, line 19
def self.register(&block)
  tab = self.new

  yield tab

  raise ArgumentError, "A tab MUST have a name!: #{tab.inspect}" if tab.name.blank?
  raise ArgumentError, "A tab MUST have a partial!: #{tab.inspect}" if tab.partial.blank?

  tab.templates = %w[all] if tab.templates.blank?
  tab.templates = Array(tab.templates)

  tab
end