Class: Ayadn::SetCounts
Instance Attribute Summary
Attributes inherited from SetBase
Instance Method Summary collapse
-
#initialize ⇒ SetCounts
constructor
A new instance of SetCounts.
- #method_missing(meth, options) ⇒ Object
- #validate(value) ⇒ Object
Methods inherited from SetBase
Constructor Details
#initialize ⇒ SetCounts
Returns a new instance of SetCounts.
606 607 608 609 |
# File 'lib/ayadn/set.rb', line 606 def initialize super @category = 'counts' end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(meth, options) ⇒ Object
615 616 617 618 619 620 621 622 623 624 |
# File 'lib/ayadn/set.rb', line 615 def method_missing(meth, ) @input = meth.to_s.capitalize @output = validate(.to_i) case meth.to_s when 'default', 'unified', 'checkins', 'conversations', 'global', 'photos', 'trending', 'mentions', 'convo', 'posts', 'messages', 'search', 'whoreposted', 'whostarred', 'whatstarred', 'files' Settings.[:counts][meth.to_sym] = @output else super end end |
Instance Method Details
#validate(value) ⇒ Object
611 612 613 |
# File 'lib/ayadn/set.rb', line 611 def validate(value) Validators.index_range(1, 200, value) end |