Sha256: 302ed00045dfe3dd1807a3d2af2721aa76c317e43293f18c971cf6def1198c84

Contents?: true

Size: 801 Bytes

Versions: 4

Compression:

Stored size: 801 Bytes

Contents

module Popular
  # Namespace for classes and modules that handle including the library's modules
  module Extenders

    # Namespace for classes and modules that handle making a given model friendly
    module Popular

      # Helper method for determining whether or not a model has included
      # the Popular module
      #
      # @return [Boolean] whether or not the including class has included the module
      def popular?
        false
      end

      # Includes the module in a given class
      #
      # @overload friendable *args
      #   @param [Hash] options
      def popular *args
        require 'popular/popular'
        include ::Popular::Popular
        
        class_eval do
          def self.popular?
            true
          end
        end
      end

    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
popular-0.3.1 lib/popular/extenders/popular.rb
popular-0.3.0 lib/popular/extenders/popular.rb
popular-0.1.0 lib/popular/extenders/popular.rb
popular-0.0.1 lib/popular/extenders/popular.rb