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.
554 555 556 557 |
# File 'lib/ayadn/set.rb', line 554 def initialize super @category = 'counts' end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(meth, options) ⇒ Object
563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 |
# File 'lib/ayadn/set.rb', line 563 def method_missing(meth, ) @input = meth.to_s.capitalize @output = validate(.to_i) case meth.to_s when 'default' Settings..counts.default = @output when 'unified' Settings..counts.unified = @output when 'checkins' Settings..counts.checkins = @output when 'conversations' Settings..counts.conversations = @output when 'global' Settings..counts.global = @output when 'photos' Settings..counts.photos = @output when 'trending' Settings..counts.trending = @output when 'mentions' Settings..counts.mentions = @output when 'convo' Settings..counts.convo = @output when 'posts' Settings..counts.posts = @output when 'messages' Settings..counts. = @output when 'search' Settings..counts.search = @output when 'whoreposted' Settings..counts.whoreposted = @output when 'whostarred' Settings..counts.whostarred = @output when 'whatstarred' Settings..counts.whatstarred = @output when 'files' Settings..counts.files = @output else super end end |
Instance Method Details
#validate(value) ⇒ Object
559 560 561 |
# File 'lib/ayadn/set.rb', line 559 def validate(value) Validators.index_range(1, 200, value) end |