Class: Ayadn::SetChannels

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

#initializeSetChannels

Returns a new instance of SetChannels.



558
559
560
561
# File 'lib/ayadn/set.rb', line 558

def initialize
  super
  @category = 'channels'
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(meth, options) ⇒ Object



567
568
569
570
571
572
573
574
575
576
# File 'lib/ayadn/set.rb', line 567

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

Instance Method Details

#validate(value) ⇒ Object



563
564
565
# File 'lib/ayadn/set.rb', line 563

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