Class: ExpressAdmin::Components::Presenters::SmartTable::Column
- Inherits:
-
Object
- Object
- ExpressAdmin::Components::Presenters::SmartTable::Column
- Defined in:
- app/components/express_admin/smart_table.rb
Instance Attribute Summary collapse
-
#accessor ⇒ Object
readonly
Returns the value of attribute accessor.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#table_column ⇒ Object
readonly
Returns the value of attribute table_column.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
- #accessor_match(regex) ⇒ Object
-
#initialize(accessor, title = nil) ⇒ Column
constructor
A new instance of Column.
Constructor Details
#initialize(accessor, title = nil) ⇒ Column
Returns a new instance of Column.
233 234 235 236 237 238 |
# File 'app/components/express_admin/smart_table.rb', line 233 def initialize(accessor, title = nil) @name = accessor.kind_of?(Symbol) ? accessor.to_s.underscore : title.titleize.gsub(/\s+/,'').underscore @accessor = accessor @title = title || @name.titleize @table_column = table_column end |
Instance Attribute Details
#accessor ⇒ Object (readonly)
Returns the value of attribute accessor.
232 233 234 |
# File 'app/components/express_admin/smart_table.rb', line 232 def accessor @accessor end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
232 233 234 |
# File 'app/components/express_admin/smart_table.rb', line 232 def name @name end |
#table_column ⇒ Object (readonly)
Returns the value of attribute table_column.
232 233 234 |
# File 'app/components/express_admin/smart_table.rb', line 232 def table_column @table_column end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
232 233 234 |
# File 'app/components/express_admin/smart_table.rb', line 232 def title @title end |
Instance Method Details
#accessor_match(regex) ⇒ Object
248 249 250 |
# File 'app/components/express_admin/smart_table.rb', line 248 def accessor_match(regex) accessor.to_s.match(regex).try(:[], 1) end |