Class: TableHelper::Column
- Inherits:
-
Object
- Object
- TableHelper::Column
- Defined in:
- lib/table_for/column.rb
Overview
:nodoc:
Direct Known Subclasses
Instance Attribute Summary collapse
-
#html ⇒ Object
readonly
Returns the value of attribute html.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
- #content_for ⇒ Object
- #draw_title ⇒ Object
-
#initialize(template, obj, ops) ⇒ Column
constructor
A new instance of Column.
Constructor Details
#initialize(template, obj, ops) ⇒ Column
Returns a new instance of Column.
6 7 8 9 10 |
# File 'lib/table_for/column.rb', line 6 def initialize(template, obj, ops) @template, @attr, @options = template, obj, ops @title = @options.delete(:title) || @attr.to_s.humanize.presence || " " @html = @options.delete(:html) || {} end |
Instance Attribute Details
#html ⇒ Object (readonly)
Returns the value of attribute html.
3 4 5 |
# File 'lib/table_for/column.rb', line 3 def html @html end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
3 4 5 |
# File 'lib/table_for/column.rb', line 3 def title @title end |
Instance Method Details
#content_for ⇒ Object
12 13 14 |
# File 'lib/table_for/column.rb', line 12 def content_for raise NoMethodError, "Use SimpleColumn or CallbackColumn" end |
#draw_title ⇒ Object
16 17 18 19 20 |
# File 'lib/table_for/column.rb', line 16 def draw_title content_tag :th, @html[:th] do @title end end |