Class: ActiveList::Column
- Inherits:
-
Object
- Object
- ActiveList::Column
- Defined in:
- lib/active-list/definition.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
-
#options ⇒ Object
Returns the value of attribute options.
-
#table ⇒ Object
Returns the value of attribute table.
Instance Method Summary collapse
- #exportable? ⇒ Boolean
- #header_code ⇒ Object
-
#initialize(table, name, options = {}) ⇒ Column
constructor
A new instance of Column.
-
#simple_id ⇒ Object
Uncommon but simple identifier for CSS class uses.
- #sortable? ⇒ Boolean
-
#unique_id ⇒ Object
Unique identifier of the column in the application.
Constructor Details
#initialize(table, name, options = {}) ⇒ Column
Returns a new instance of Column.
67 68 69 70 71 72 73 |
# File 'lib/active-list/definition.rb', line 67 def initialize(table, name, ={}) @table = table @name = name @options = @column = @table.model.columns.detect{|c| c.name.to_s == @name.to_s } @id = @table.new_id end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
65 66 67 |
# File 'lib/active-list/definition.rb', line 65 def id @id end |
#name ⇒ Object
Returns the value of attribute name.
64 65 66 |
# File 'lib/active-list/definition.rb', line 64 def name @name end |
#options ⇒ Object
Returns the value of attribute options.
64 65 66 |
# File 'lib/active-list/definition.rb', line 64 def @options end |
#table ⇒ Object
Returns the value of attribute table.
64 65 66 |
# File 'lib/active-list/definition.rb', line 64 def table @table end |
Instance Method Details
#exportable? ⇒ Boolean
83 84 85 |
# File 'lib/active-list/definition.rb', line 83 def exportable? false end |
#header_code ⇒ Object
75 76 77 |
# File 'lib/active-list/definition.rb', line 75 def header_code raise NotImplementedError.new("#{self.class.name}#header_code is not implemented.") end |
#simple_id ⇒ Object
Uncommon but simple identifier for CSS class uses
93 94 95 |
# File 'lib/active-list/definition.rb', line 93 def simple_id "_#{@table.id}_#{@id}" end |
#sortable? ⇒ Boolean
79 80 81 |
# File 'lib/active-list/definition.rb', line 79 def sortable? false end |
#unique_id ⇒ Object
Unique identifier of the column in the application
88 89 90 |
# File 'lib/active-list/definition.rb', line 88 def unique_id "#{@table.name}-#{@id}" end |