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.



295
296
297
298
# File 'lib/ayadn/set.rb', line 295

def initialize
  super
  @category = 'formats'
end

Instance Method Details

#list(args) ⇒ Object



322
323
324
325
326
327
328
329
330
331
332
333
# File 'lib/ayadn/set.rb', line 322

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



335
336
337
# File 'lib/ayadn/set.rb', line 335

def lists(args)
  list(args)
end

#table(args) ⇒ Object



300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
# File 'lib/ayadn/set.rb', line 300

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



318
319
320
# File 'lib/ayadn/set.rb', line 318

def tables(args)
  table(args)
end