Class: Ayadn::SetColor
Instance Attribute Summary
Attributes inherited from SetBase
Instance Method Summary collapse
-
#initialize ⇒ SetColor
constructor
A new instance of SetColor.
- #method_missing(meth, options) ⇒ Object
- #validate(color) ⇒ Object
Methods inherited from SetBase
Constructor Details
#initialize ⇒ SetColor
Returns a new instance of SetColor.
654 655 656 657 |
# File 'lib/ayadn/set.rb', line 654 def initialize super @category = 'colors' end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(meth, options) ⇒ Object
663 664 665 666 667 668 669 670 671 672 673 674 675 676 |
# File 'lib/ayadn/set.rb', line 663 def method_missing(meth, ) @input = meth.to_s.capitalize @output = validate() case meth.to_s when 'id', 'index', 'username', 'name', 'date', 'link', 'dots', 'hashtags', 'mentions', 'source', 'symbols', 'unread', 'debug', 'excerpt' Settings.[:colors][meth.to_sym] = @output when 'hashtag', 'mention', 'symbol' Settings.[:colors]["#{meth}s".to_sym] = @output when 'client' Settings.[:colors][:source] = @output else super end end |
Instance Method Details
#validate(color) ⇒ Object
659 660 661 |
# File 'lib/ayadn/set.rb', line 659 def validate(color) Validators.color(color) end |