class Trestle::Table

Attributes

columns[R]
options[RW]
row[W]

Public Class Methods

new(options={}) click to toggle source
# File lib/trestle/table.rb, line 14
def initialize(options={})
  @options = options
  @columns = []
end

Public Instance Methods

admin() click to toggle source
# File lib/trestle/table.rb, line 25
def admin
  Trestle.lookup(options[:admin]) if options.key?(:admin)
end
header?() click to toggle source
# File lib/trestle/table.rb, line 37
def header?
  options[:header] != false
end
renderer(template) click to toggle source
# File lib/trestle/table.rb, line 41
def renderer(template)
  Renderer.new(self, template)
end
row() click to toggle source
# File lib/trestle/table.rb, line 45
def row
  @row || Row.new
end
sortable?() click to toggle source
# File lib/trestle/table.rb, line 29
def sortable?
  options[:sortable] == true
end
with_options(opts={}) click to toggle source
# File lib/trestle/table.rb, line 19
def with_options(opts={})
  dup.tap do |table|
    table.options = options.merge(opts)
  end
end