Class: Ayadn::SetBlacklist

Inherits:
SetBase
  • Object
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.



507
508
509
510
# File 'lib/ayadn/set.rb', line 507

def initialize
  super
  @category = 'blacklist'
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(meth, options) ⇒ Object



516
517
518
519
520
521
522
523
524
525
# File 'lib/ayadn/set.rb', line 516

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

Instance Method Details

#validate(value) ⇒ Object



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

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