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
433 434 435 436 |
# File 'lib/ayadn/set.rb', line 433 def initialize super @category = 'counts' end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(meth, options) ⇒ Object
442 443 444 445 446 447 448 449 450 451 |
# File 'lib/ayadn/set.rb', line 442 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
438 439 440 |
# File 'lib/ayadn/set.rb', line 438 def validate(value) Validators.index_range(1, 200, value) end |