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

Instance Method Details

Includes the module in a given class

Parameters:

  • options (Hash)

Options Hash (*args):

  • :friendship_profile (Boolean)

    whether or not friendships should create a friendship_profile



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.extract_options!.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

Returns:

  • (Boolean)

    whether or not the including class has included the module



12
13
14
# File 'lib/popular/extenders/popular.rb', line 12

def popular?
  false
end