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.



250
251
252
253
# File 'lib/ayadn/set.rb', line 250

def initialize
  super
  @category = 'formats'
end

Instance Method Details

#list(args) ⇒ Object



271
272
273
274
275
276
277
278
279
280
281
# File 'lib/ayadn/set.rb', line 271

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



283
284
285
# File 'lib/ayadn/set.rb', line 283

def lists(args)
  list(args)
end

#table(args) ⇒ Object



255
256
257
258
259
260
261
262
263
264
265
# File 'lib/ayadn/set.rb', line 255

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



267
268
269
# File 'lib/ayadn/set.rb', line 267

def tables(args)
  table(args)
end