Class: ExpressAdmin::Components::Presenters::SmartTable::Column

Inherits:
Object
  • Object
show all
Includes:
Helper
Defined in:
app/components/express_admin/smart_table.rb

Constant Summary

Constants included from Helper

Helper::COLUMN_REGEX_LIST

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Helper

#accessor_match, #checkmark, #checkmark?, #link, #link?, #make_checkmark, #make_in_words, #make_link, #words, #words?

Constructor Details

#initialize(accessor, title = nil) ⇒ Column

Returns a new instance of Column.



226
227
228
229
230
231
# File 'app/components/express_admin/smart_table.rb', line 226

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

#accessorObject (readonly)

Returns the value of attribute accessor.



225
226
227
# File 'app/components/express_admin/smart_table.rb', line 225

def accessor
  @accessor
end

#nameObject (readonly)

Returns the value of attribute name.



225
226
227
# File 'app/components/express_admin/smart_table.rb', line 225

def name
  @name
end

#table_columnObject (readonly)

Returns the value of attribute table_column.



225
226
227
# File 'app/components/express_admin/smart_table.rb', line 225

def table_column
  @table_column
end

#titleObject (readonly)

Returns the value of attribute title.



225
226
227
# File 'app/components/express_admin/smart_table.rb', line 225

def title
  @title
end