Class: Outpost::List::Column

Inherits:
Object
  • Object
show all
Defined in:
lib/outpost/list/column.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attribute, list, attributes = {}) ⇒ Column

Returns a new instance of Column.



18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/outpost/list/column.rb', line 18

def initialize(attribute, list, attributes={})
  @attribute = attribute.to_s
  @list      = list
  @position  = @list.columns.size

  @header     = attributes[:header] || @attribute.titleize
  @display    = attributes[:display]
  @quick_edit = !!attributes[:quick_edit]
  @sortable   = !!attributes[:sortable]

  @default_order_direction =
    attributes[:default_order_direction] || List::DEFAULT_ORDER_DIRECTION
end

Instance Attribute Details

#_display_helperObject

Returns the value of attribute _display_helper.



4
5
6
# File 'lib/outpost/list/column.rb', line 4

def _display_helper
  @_display_helper
end

#attributeObject

Returns the value of attribute attribute.



4
5
6
# File 'lib/outpost/list/column.rb', line 4

def attribute
  @attribute
end

#default_order_directionObject

Returns the value of attribute default_order_direction.



4
5
6
# File 'lib/outpost/list/column.rb', line 4

def default_order_direction
  @default_order_direction
end

#displayObject

Returns the value of attribute display.



4
5
6
# File 'lib/outpost/list/column.rb', line 4

def display
  @display
end

#headerObject

Returns the value of attribute header.



4
5
6
# File 'lib/outpost/list/column.rb', line 4

def header
  @header
end

#listObject

Returns the value of attribute list.



4
5
6
# File 'lib/outpost/list/column.rb', line 4

def list
  @list
end

#positionObject

Returns the value of attribute position.



4
5
6
# File 'lib/outpost/list/column.rb', line 4

def position
  @position
end

#quick_editObject Also known as: quick_edit?

Returns the value of attribute quick_edit.



4
5
6
# File 'lib/outpost/list/column.rb', line 4

def quick_edit
  @quick_edit
end

#sortableObject Also known as: sortable?

Returns the value of attribute sortable.



4
5
6
# File 'lib/outpost/list/column.rb', line 4

def sortable
  @sortable
end