Class: ExpressAdmin::SmartTable::Column

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#accessorObject (readonly)

Returns the value of attribute accessor.



148
149
150
# File 'app/components/express_admin/smart_table.rb', line 148

def accessor
  @accessor
end

#nameObject (readonly)

Returns the value of attribute name.



148
149
150
# File 'app/components/express_admin/smart_table.rb', line 148

def name
  @name
end

#titleObject (readonly)

Returns the value of attribute title.



148
149
150
# File 'app/components/express_admin/smart_table.rb', line 148

def title
  @title
end