Class: Effective::DatatableColumn

Inherits:
Object
  • Object
show all
Defined in:
app/models/effective/datatable_column.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes) ⇒ DatatableColumn

Returns a new instance of DatatableColumn.



10
11
12
# File 'app/models/effective/datatable_column.rb', line 10

def initialize(attributes)
  @attributes = attributes
end

Instance Attribute Details

#attributesObject

Returns the value of attribute attributes.



6
7
8
# File 'app/models/effective/datatable_column.rb', line 6

def attributes
  @attributes
end

Instance Method Details

#aggregate(&block) ⇒ Object



18
19
20
# File 'app/models/effective/datatable_column.rb', line 18

def aggregate(&block)
  @attributes[:aggregate] = block; self
end

#format(&block) ⇒ Object



22
23
24
# File 'app/models/effective/datatable_column.rb', line 22

def format(&block)
  @attributes[:format] = block; self
end

#format_each(&block) ⇒ Object



26
27
28
# File 'app/models/effective/datatable_column.rb', line 26

def format_each(&block)
  @attributes[:format_each] = block; self
end

#search(&block) ⇒ Object



30
31
32
# File 'app/models/effective/datatable_column.rb', line 30

def search(&block)
  @attributes[:search_method] = block; self
end

#sort(&block) ⇒ Object



34
35
36
# File 'app/models/effective/datatable_column.rb', line 34

def sort(&block)
  @attributes[:sort_method] = block; self
end

#to_sObject



14
15
16
# File 'app/models/effective/datatable_column.rb', line 14

def to_s
  self[:name]
end