Class: ExpressAdmin::SmartTable::Column
- Inherits:
-
Object
- Object
- ExpressAdmin::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.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
-
#initialize(accessor, title = nil) ⇒ Column
constructor
A new instance of Column.
Constructor Details
#initialize(accessor, title = nil) ⇒ Column
Returns a new instance of Column.
149 150 151 152 153 |
# File 'app/components/express_admin/smart_table.rb', line 149 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 end |
Instance Attribute Details
#accessor ⇒ Object (readonly)
Returns the value of attribute accessor.
148 149 150 |
# File 'app/components/express_admin/smart_table.rb', line 148 def accessor @accessor end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
148 149 150 |
# File 'app/components/express_admin/smart_table.rb', line 148 def name @name end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
148 149 150 |
# File 'app/components/express_admin/smart_table.rb', line 148 def title @title end |