Class: Ayadn::SetChannels

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

#initializeSetChannels

Returns a new instance of SetChannels.



483
484
485
486
# File 'lib/ayadn/set.rb', line 483

def initialize
  super
  @category = 'channels'
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(meth, options) ⇒ Object



492
493
494
495
496
497
498
499
500
501
# File 'lib/ayadn/set.rb', line 492

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



488
489
490
# File 'lib/ayadn/set.rb', line 488

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