Module: Popular::Extenders::Popular
- Defined in:
- lib/popular/extenders/popular.rb
Overview
Namespace for classes and modules that handle making a given model popular
Instance Method Summary collapse
-
#popular(*args) ⇒ Object
Includes the module in a given class.
-
#popular? ⇒ Boolean
Helper method for determining whether or not a model has included the Popular module.
Instance Method Details
#popular(*args) ⇒ Object
Includes the module in a given class
21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/popular/extenders/popular.rb', line 21 def popular *args require 'popular/popular' include ::Popular::Popular args..each do |key, val| send "#{key}=", val end class_eval do def self.popular? true end end end |
#popular? ⇒ Boolean
Helper method for determining whether or not a model has included the Popular module
12 13 14 |
# File 'lib/popular/extenders/popular.rb', line 12 def popular? false end |