Class: Trestle::Table
- Inherits:
-
Object
- Object
- Trestle::Table
- Extended by:
- ActiveSupport::Autoload
- Defined in:
- lib/trestle/table.rb,
lib/trestle/table/row.rb,
lib/trestle/table/column.rb,
lib/trestle/table/builder.rb,
lib/trestle/table/automatic.rb,
lib/trestle/table/select_column.rb,
lib/trestle/table/actions_column.rb
Direct Known Subclasses
Defined Under Namespace
Classes: ActionsColumn, Automatic, Builder, Column, Renderer, Row, SelectColumn
Instance Attribute Summary collapse
-
#columns ⇒ Object
readonly
Returns the value of attribute columns.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
- #row ⇒ Object
Instance Method Summary collapse
- #admin ⇒ Object
- #autolink? ⇒ Boolean
-
#initialize(options = {}) ⇒ Table
constructor
A new instance of Table.
- #renderer(template) ⇒ Object
- #sortable? ⇒ Boolean
Constructor Details
#initialize(options = {}) ⇒ Table
Returns a new instance of Table.
15 16 17 18 |
# File 'lib/trestle/table.rb', line 15 def initialize(={}) @options = @columns = [] end |
Instance Attribute Details
#columns ⇒ Object (readonly)
Returns the value of attribute columns.
12 13 14 |
# File 'lib/trestle/table.rb', line 12 def columns @columns end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
12 13 14 |
# File 'lib/trestle/table.rb', line 12 def @options end |
Instance Method Details
#admin ⇒ Object
20 21 22 |
# File 'lib/trestle/table.rb', line 20 def admin Trestle.lookup([:admin]) if .key?(:admin) end |
#autolink? ⇒ Boolean
28 29 30 |
# File 'lib/trestle/table.rb', line 28 def autolink? [:autolink] != false end |
#renderer(template) ⇒ Object
32 33 34 |
# File 'lib/trestle/table.rb', line 32 def renderer(template) Renderer.new(self, template) end |
#sortable? ⇒ Boolean
24 25 26 |
# File 'lib/trestle/table.rb', line 24 def sortable? [:sortable] == true end |