Module: Tablets::Global::Configurator

Included in:
Tablets
Defined in:
lib/tablets/global/configurator.rb

Overview

Responsible to make application configurable

Constant Summary collapse

DEFAULT_OPTIONS =
{
  pageLength: 15,
  processing: false,
  info: true,
  lengthChange: false,
  serverSide: true,
  pagingType: 'full_numbers',
  order: [0, 'asc'],
  autoWidth: true,
  orderCellsTop: true,
  serverMethod: 'POST',
  language: {
    lengthMenu: '<span class=\'seperator\'>|</span>View _MENU_ records',
    info: '<span class=\'seperator\'>|</span>Found total _TOTAL_ records',
    infoEmpty: '',
    emptyTable: 'No records found to show',
    zeroRecords: 'No matching records found',
    paginate: {
      previous: 'Prev',
      next: 'Next',
      last: 'Last',
      first: 'First',
      page: 'Page',
      pageOf: 'of'
    }
  }
}

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#optionsObject

Returns the value of attribute options.



7
8
9
# File 'lib/tablets/global/configurator.rb', line 7

def options
  @options
end

#tablets_dirObject

Returns the value of attribute tablets_dir.



8
9
10
# File 'lib/tablets/global/configurator.rb', line 8

def tablets_dir
  @tablets_dir
end

Class Method Details

.extended(base) ⇒ Object

Initialize default config values



16
17
18
19
# File 'lib/tablets/global/configurator.rb', line 16

def self.extended(base)
  base.options = DEFAULT_OPTIONS
  base.tablets_dir = File.expand_path('app/tablets', Rails.root)
end

Instance Method Details

#setup {|_self| ... } ⇒ Object

Setup configuration. Used in initializers

Yields:

  • (_self)

Yield Parameters:



11
12
13
# File 'lib/tablets/global/configurator.rb', line 11

def setup
  yield self
end