Class: Ayadn::SetFormats

Inherits:
SetBase show all
Defined in:
lib/ayadn/set.rb

Instance Attribute Summary

Attributes inherited from SetBase

#category, #input, #output

Instance Method Summary collapse

Methods inherited from SetBase

#log, #save

Constructor Details

#initializeSetFormats

Returns a new instance of SetFormats.



344
345
346
347
# File 'lib/ayadn/set.rb', line 344

def initialize
  super
  @category = 'formats'
end

Instance Method Details

#list(args) ⇒ Object



371
372
373
374
375
376
377
378
379
380
381
382
# File 'lib/ayadn/set.rb', line 371

def list(args)
  type = args.shift.downcase
  value = args[0]
  if type == 'reverse' || type == 'reversed'
    @input = 'list reverse'
    @output = Validators.boolean(value)
    Settings.options.formats.list.reverse = @output
  else
    @status.error_missing_parameters
    exit
  end
end

#lists(args) ⇒ Object



384
385
386
# File 'lib/ayadn/set.rb', line 384

def lists(args)
  list(args)
end

#table(args) ⇒ Object



349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
# File 'lib/ayadn/set.rb', line 349

def table(args)
  type = args.shift.downcase
  if type == 'width'
    value = args[0].to_i
    @input = 'table width'
    @output = Validators.width_range(value)
    Settings.options.formats.table.width = @output
  elsif type == 'borders' || type == 'border'
    value = args[0]
    @input = 'table borders'
    @output = Validators.boolean(value)
    Settings.options.formats.table.borders = @output
  else
    @status.error_missing_parameters
    exit
  end
end

#tables(args) ⇒ Object



367
368
369
# File 'lib/ayadn/set.rb', line 367

def tables(args)
  table(args)
end