Class: Refinery::Blog::Tab

Inherits:
Object
  • Object
show all
Defined in:
lib/refinery/blog/tabs.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#nameObject

Returns the value of attribute name.



4
5
6
# File 'lib/refinery/blog/tabs.rb', line 4

def name
  @name
end

#partialObject

Returns the value of attribute partial.



4
5
6
# File 'lib/refinery/blog/tabs.rb', line 4

def partial
  @partial
end

Class Method Details

.register {|tab| ... } ⇒ Object

Yields:

  • (tab)


6
7
8
9
10
11
12
13
# File 'lib/refinery/blog/tabs.rb', line 6

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