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.
642 643 644 645 |
# File 'lib/ayadn/set.rb', line 642 def initialize super @category = 'colors' end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(meth, options) ⇒ Object
651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 |
# File 'lib/ayadn/set.rb', line 651 def method_missing(meth, ) @input = meth.to_s.capitalize @output = validate() case meth.to_s when 'id' Settings..colors.id = @output when 'index' Settings..colors.index = @output when 'username' Settings..colors.username = @output when 'name' Settings..colors.name = @output when 'date' Settings..colors.date = @output when 'link' Settings..colors.link = @output when 'dots' Settings..colors.dots = @output when 'mentions', 'mention' Settings..colors.mentions = @output when 'symbols', 'symbol' Settings..colors.symbols = @output when 'unread' Settings..colors.unread = @output when 'debug' Settings..colors.debug = @output when 'excerpt' Settings..colors.excerpt = @output when 'hashtag', 'tag', 'hashtags' Settings..colors.hashtag = @output when 'client', 'source' Settings..colors.source = @output else super end end |
Instance Method Details
#validate(color) ⇒ Object
647 648 649 |
# File 'lib/ayadn/set.rb', line 647 def validate(color) Validators.color(color) end |