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.



510
511
512
513
# File 'lib/ayadn/set.rb', line 510

def initialize
  super
  @category = 'backup'
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(meth, options) ⇒ Object



519
520
521
522
523
524
525
526
527
528
# File 'lib/ayadn/set.rb', line 519

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

Instance Method Details

#validate(value) ⇒ Object



515
516
517
# File 'lib/ayadn/set.rb', line 515

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