Class: Refinery::Pages::Tab
- Inherits:
-
Object
- Object
- Refinery::Pages::Tab
- Defined in:
- pages/lib/refinery/pages/tab.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#partial ⇒ Object
Returns the value of attribute partial.
-
#templates ⇒ Object
Returns the value of attribute templates.
Class Method Summary collapse
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
17 18 19 |
# File 'pages/lib/refinery/pages/tab.rb', line 17 def name @name end |
#partial ⇒ Object
Returns the value of attribute partial.
17 18 19 |
# File 'pages/lib/refinery/pages/tab.rb', line 17 def partial @partial end |
#templates ⇒ Object
Returns the value of attribute templates.
17 18 19 |
# File 'pages/lib/refinery/pages/tab.rb', line 17 def templates @templates end |
Class Method Details
.register {|tab| ... } ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'pages/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 |