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.



262
263
264
265
# File 'lib/ayadn/set.rb', line 262

def initialize
  super
  @category = 'formats'
end

Instance Method Details

#list(args) ⇒ Object



283
284
285
286
287
288
289
290
291
292
293
# File 'lib/ayadn/set.rb', line 283

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
    abort(Status.error_missing_parameters)
  end
end

#lists(args) ⇒ Object



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

def lists(args)
  list(args)
end

#table(args) ⇒ Object



267
268
269
270
271
272
273
274
275
276
277
# File 'lib/ayadn/set.rb', line 267

def table(args)
  type = args.shift.downcase
  value = args[0].to_i
  if type == 'width'
    @input = 'table width'
    @output = Validators.width_range(value)
    Settings.options[:formats][:table][:width] = @output
  else
    abort(Status.error_missing_parameters)
  end
end

#tables(args) ⇒ Object



279
280
281
# File 'lib/ayadn/set.rb', line 279

def tables(args)
  table(args)
end