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.



370
371
372
373
# File 'lib/ayadn/set.rb', line 370

def initialize
  super
  @category = 'formats'
end

Instance Method Details

#list(args) ⇒ Object



397
398
399
400
401
402
403
404
405
406
407
408
# File 'lib/ayadn/set.rb', line 397

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



410
411
412
# File 'lib/ayadn/set.rb', line 410

def lists(args)
  list(args)
end

#table(args) ⇒ Object



375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
# File 'lib/ayadn/set.rb', line 375

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



393
394
395
# File 'lib/ayadn/set.rb', line 393

def tables(args)
  table(args)
end