Class: Ayadn::SetBackup

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

#initializeSetBackup

Returns a new instance of SetBackup.



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

def initialize
  super
  @category = 'backup'
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(meth, options) ⇒ Object



394
395
396
397
398
399
400
401
402
403
# File 'lib/ayadn/set.rb', line 394

def method_missing(meth, options)
  @input = meth.to_s
  @output = validate(options)
  case @input
  when 'auto_save_sent_posts', 'auto_save_sent_messages', 'auto_save_lists'
    Settings.options[:backup][meth.to_sym] = @output
  else
    super
  end
end

Instance Method Details

#validate(value) ⇒ Object



390
391
392
# File 'lib/ayadn/set.rb', line 390

def validate(value)
  Validators.boolean(value)
end