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.



454
455
456
457
# File 'lib/ayadn/set.rb', line 454

def initialize
  super
  @category = 'backup'
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(meth, options) ⇒ Object



463
464
465
466
467
468
469
470
471
472
473
474
475
476
# File 'lib/ayadn/set.rb', line 463

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

Instance Method Details

#validate(value) ⇒ Object



459
460
461
# File 'lib/ayadn/set.rb', line 459

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