Class: PaginatedTable::RowDescription
- Inherits:
-
Object
- Object
- PaginatedTable::RowDescription
- Defined in:
- lib/paginated_table/row_description.rb
Instance Attribute Summary collapse
-
#columns ⇒ Object
readonly
Returns the value of attribute columns.
Instance Method Summary collapse
- #colspan(span) ⇒ Object
- #column(*args, &block) ⇒ Object
- #cycle ⇒ Object
- #data_type ⇒ Object
- #hidden ⇒ Object
-
#initialize(table, options, description_proc) ⇒ RowDescription
constructor
A new instance of RowDescription.
- #title ⇒ Object
Constructor Details
#initialize(table, options, description_proc) ⇒ RowDescription
Returns a new instance of RowDescription.
5 6 7 8 9 10 |
# File 'lib/paginated_table/row_description.rb', line 5 def initialize(table, , description_proc) @table = table @options = @columns = [] description_proc.call(self) if description_proc end |
Instance Attribute Details
#columns ⇒ Object (readonly)
Returns the value of attribute columns.
3 4 5 |
# File 'lib/paginated_table/row_description.rb', line 3 def columns @columns end |
Instance Method Details
#colspan(span) ⇒ Object
32 33 34 |
# File 'lib/paginated_table/row_description.rb', line 32 def colspan(span) @table.colspan(span) end |
#column(*args, &block) ⇒ Object
28 29 30 |
# File 'lib/paginated_table/row_description.rb', line 28 def column(*args, &block) @columns << ColumnDescription.new(self, *args, &block) end |
#cycle ⇒ Object
16 17 18 |
# File 'lib/paginated_table/row_description.rb', line 16 def cycle @options.fetch(:cycle, %w(odd even)) end |
#data_type ⇒ Object
24 25 26 |
# File 'lib/paginated_table/row_description.rb', line 24 def data_type @options.fetch(:data_type, false) end |
#hidden ⇒ Object
20 21 22 |
# File 'lib/paginated_table/row_description.rb', line 20 def hidden @options.fetch(:hidden, false) end |
#title ⇒ Object
12 13 14 |
# File 'lib/paginated_table/row_description.rb', line 12 def title @options.fetch(:title, :header) end |