Class: ActiveList::Definition::AbstractColumn
- Inherits:
-
Object
- Object
- ActiveList::Definition::AbstractColumn
- Defined in:
- lib/active_list/definition/abstract_column.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
(also: #sort_id)
readonly
Returns the value of attribute name.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#table ⇒ Object
readonly
Returns the value of attribute table.
Instance Method Summary collapse
- #check_options!(options, *keys) ⇒ Object
- #computable? ⇒ Boolean
- #exportable? ⇒ Boolean
- #header_code ⇒ Object
- #hidden? ⇒ Boolean
-
#initialize(table, name, options = {}) ⇒ AbstractColumn
constructor
A new instance of AbstractColumn.
-
#short_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 = {}) ⇒ AbstractColumn
Returns a new instance of AbstractColumn.
6 7 8 9 10 11 12 |
# File 'lib/active_list/definition/abstract_column.rb', line 6 def initialize(table, name, = {}) @table = table @name = name.to_sym @options = @hidden = !!@options.delete(:hidden) @id = 'c' + @table.new_column_id # ActiveList.new_uid end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
4 5 6 |
# File 'lib/active_list/definition/abstract_column.rb', line 4 def id @id end |
#name ⇒ Object (readonly) Also known as: sort_id
Returns the value of attribute name.
4 5 6 |
# File 'lib/active_list/definition/abstract_column.rb', line 4 def name @name end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
4 5 6 |
# File 'lib/active_list/definition/abstract_column.rb', line 4 def @options end |
#table ⇒ Object (readonly)
Returns the value of attribute table.
4 5 6 |
# File 'lib/active_list/definition/abstract_column.rb', line 4 def table @table end |
Instance Method Details
#check_options!(options, *keys) ⇒ Object
46 47 48 49 50 |
# File 'lib/active_list/definition/abstract_column.rb', line 46 def (, *keys) for key in .keys raise ArgumentError, "Key :#{key} is unexpected. (Expecting: #{keys.to_sentence})" end end |
#computable? ⇒ Boolean
30 31 32 |
# File 'lib/active_list/definition/abstract_column.rb', line 30 def computable? false end |
#exportable? ⇒ Boolean
26 27 28 |
# File 'lib/active_list/definition/abstract_column.rb', line 26 def exportable? false end |
#header_code ⇒ Object
14 15 16 |
# File 'lib/active_list/definition/abstract_column.rb', line 14 def header_code raise NotImplementedError, "#{self.class.name}#header_code is not implemented." end |
#hidden? ⇒ Boolean
18 19 20 |
# File 'lib/active_list/definition/abstract_column.rb', line 18 def hidden? @hidden end |
#short_id ⇒ Object
Uncommon but simple identifier for CSS class uses
40 41 42 |
# File 'lib/active_list/definition/abstract_column.rb', line 40 def short_id @id end |
#sortable? ⇒ Boolean
22 23 24 |
# File 'lib/active_list/definition/abstract_column.rb', line 22 def sortable? false end |
#unique_id ⇒ Object
Unique identifier of the column in the application
35 36 37 |
# File 'lib/active_list/definition/abstract_column.rb', line 35 def unique_id "#{@table.name}-#{@name}" end |