lib/phlex/table.rb in phlex-1.0.0.rc2 vs lib/phlex/table.rb in phlex-1.0.0
- old
+ new
@@ -48,29 +48,27 @@
child.alias_method :head_cell, :cell
child.alias_method :body_cell, :cell
child.alias_method :foot_cell, :cell
end
- private
-
- def properties
+ private def properties
self.class.properties
end
- def collection_template(&block)
+ private def collection_template(&block)
table do
head_template
body_template(&block)
foot_template
end
end
- def item_template
+ private def item_template
row_template
end
- def head_template
+ private def head_template
if self.class.properties.any? { |p| p[:header] }
head do
head_row do
self.class.properties.each do |property|
case property[:header]
@@ -83,17 +81,17 @@
end
end
end
end
- def body_template
+ private def body_template
body { yield_items }
end
- def foot_template
+ private def foot_template
end
- def row_template
+ private def row_template
body_row do
self.class.properties.each do |property|
body_cell(**property[:attributes]) do
instance_exec(@item, &property[:body])
end