Class: Ayadn::SetBlacklist

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

#initializeSetBlacklist

Returns a new instance of SetBlacklist.



530
531
532
533
# File 'lib/ayadn/set.rb', line 530

def initialize
  super
  @category = 'blacklist'
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(meth, options) ⇒ Object



539
540
541
542
543
544
545
546
547
548
# File 'lib/ayadn/set.rb', line 539

def method_missing(meth, options)
  @input = meth.to_s
  @output = validate(options)
  case @input
  when 'active', 'activated'
    Settings.options.blacklist.active = @output
  else
    super
  end
end

Instance Method Details

#validate(value) ⇒ Object



535
536
537
# File 'lib/ayadn/set.rb', line 535

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