Module: FluidTable::ClassMethods
- Included in:
- FluidTable
- Defined in:
- lib/fluid_table/class_methods.rb
Instance Method Summary collapse
Instance Method Details
#define_column(*args, &proc) ⇒ Object
4 5 6 7 8 9 10 11 |
# File 'lib/fluid_table/class_methods.rb', line 4 def define_column(*args, &proc) = [Hash,Proc].include?(args.last.class) ? args.pop : {} identity, alt_name = *args Column.new(self, identity, alt_name, , &proc).tap do |column| (self.class_columns ||= Array.new).push(column) column.default_position = class_columns.index(column) end end |
#render(view, records = nil) ⇒ Object
13 14 15 |
# File 'lib/fluid_table/class_methods.rb', line 13 def render(view,records = nil) new(view).render(records) end |
#valid? ⇒ Boolean
17 18 19 |
# File 'lib/fluid_table/class_methods.rb', line 17 def valid? !class_columns.empty? end |