Class: Listings::ColumnDescriptor

Inherits:
BaseFieldDescriptor show all
Defined in:
lib/listings/column_descriptor.rb

Instance Attribute Summary

Attributes inherited from BaseFieldDescriptor

#path, #proc, #props

Instance Method Summary collapse

Methods inherited from BaseFieldDescriptor

#build_field, #is_field?

Constructor Details

#initialize(path, props, proc) ⇒ ColumnDescriptor

Returns a new instance of ColumnDescriptor.



3
4
5
6
# File 'lib/listings/column_descriptor.rb', line 3

def initialize(path, props, proc)
  props = props.reverse_merge! searchable: false, sortable: true
  super(path, props, proc)
end

Instance Method Details

#searchable?Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/listings/column_descriptor.rb', line 8

def searchable?
  @props[:searchable] && is_field?
end

#sortable?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/listings/column_descriptor.rb', line 12

def sortable?
  @props[:sortable] && is_field?
end