Class: TableMe::Builder
- Inherits:
-
Object
- Object
- TableMe::Builder
- Defined in:
- lib/table_me/builder.rb
Overview
This class is responsible for building the various elements of the table through a blog passed into the table_for_presenter
Instance Attribute Summary collapse
-
#columns ⇒ Object
readonly
Returns the value of attribute columns.
-
#filters ⇒ Object
readonly
Returns the value of attribute filters.
-
#names ⇒ Object
readonly
Returns the value of attribute names.
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
- #clear_filter ⇒ Object
-
#column(name, options = {}, &block) ⇒ Object
Define a column.
-
#filter(name) ⇒ Object
define a filter.
-
#initialize(table_options) ⇒ Builder
constructor
A new instance of Builder.
Constructor Details
#initialize(table_options) ⇒ Builder
Returns a new instance of Builder.
10 11 12 13 14 |
# File 'lib/table_me/builder.rb', line 10 def initialize self. = @columns = [] @names = [] end |
Instance Attribute Details
#columns ⇒ Object (readonly)
Returns the value of attribute columns.
9 10 11 |
# File 'lib/table_me/builder.rb', line 9 def columns @columns end |
#filters ⇒ Object (readonly)
Returns the value of attribute filters.
9 10 11 |
# File 'lib/table_me/builder.rb', line 9 def filters @filters end |
#names ⇒ Object (readonly)
Returns the value of attribute names.
9 10 11 |
# File 'lib/table_me/builder.rb', line 9 def names @names end |
#options ⇒ Object
Returns the value of attribute options.
8 9 10 |
# File 'lib/table_me/builder.rb', line 8 def @options end |
Instance Method Details
#clear_filter ⇒ Object
31 32 33 34 |
# File 'lib/table_me/builder.rb', line 31 def clear_filter # TODO this seems a bit hacky to me, Will want to rework this at some point filters.last.display_clear end |