Module: TableCloth::Extensions::RowAttributes::ClassMethods
- Defined in:
- lib/table_cloth/extensions/row_attributes.rb
Instance Method Summary collapse
Instance Method Details
#row_attributes(*args, &block) ⇒ Object
9 10 11 12 13 14 |
# File 'lib/table_cloth/extensions/row_attributes.rb', line 9 def row_attributes(*args, &block) @tr_options ||= {} = args. || {} [:proc] = block if block_given? @tr_options = end |
#tr_options ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/table_cloth/extensions/row_attributes.rb', line 16 def @tr_options ||= {} if superclass.respond_to? :tr_options @tr_options = superclass..merge(@tr_options) end @tr_options end |
#tr_options_for(object) ⇒ Object
24 25 26 27 28 29 30 31 32 |
# File 'lib/table_cloth/extensions/row_attributes.rb', line 24 def (object) = if .include?(:proc) result = [:proc].call(object) || {} .except(:proc).merge(result) else end end |