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
-
#condition ⇒ Object
readonly
Returns the value of attribute condition.
-
#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 13 |
# 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) @condition = @options.delete(:condition) @id = 'c' + @table.new_column_id # ActiveList.new_uid end |
Instance Attribute Details
#condition ⇒ Object (readonly)
Returns the value of attribute condition.
4 5 6 |
# File 'lib/active_list/definition/abstract_column.rb', line 4 def condition @condition end |
#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
47 48 49 50 51 |
# File 'lib/active_list/definition/abstract_column.rb', line 47 def (, *keys) for key in .keys raise ArgumentError, "Key :#{key} is unexpected. (Expecting: #{keys.to_sentence})" end end |
#computable? ⇒ Boolean
31 32 33 |
# File 'lib/active_list/definition/abstract_column.rb', line 31 def computable? false end |
#exportable? ⇒ Boolean
27 28 29 |
# File 'lib/active_list/definition/abstract_column.rb', line 27 def exportable? false end |
#header_code ⇒ Object
15 16 17 |
# File 'lib/active_list/definition/abstract_column.rb', line 15 def header_code raise NotImplementedError, "#{self.class.name}#header_code is not implemented." end |
#hidden? ⇒ Boolean
19 20 21 |
# File 'lib/active_list/definition/abstract_column.rb', line 19 def hidden? @hidden end |
#short_id ⇒ Object
Uncommon but simple identifier for CSS class uses
41 42 43 |
# File 'lib/active_list/definition/abstract_column.rb', line 41 def short_id @id end |
#sortable? ⇒ Boolean
23 24 25 |
# File 'lib/active_list/definition/abstract_column.rb', line 23 def sortable? false end |
#unique_id ⇒ Object
Unique identifier of the column in the application
36 37 38 |
# File 'lib/active_list/definition/abstract_column.rb', line 36 def unique_id "#{@table.name}-#{@name}" end |