module FiveStar::Rateable::ClassMethods
Public Instance Methods
configuration()
click to toggle source
Reference to Configuration
used for this rateable
instance.
@return [FiveStar::Configuration] Configuration
instance in use
@api private
# File lib/five-star/rateable.rb, line 60 def configuration @configuration ||= Configuration.new end
rate_with(*klasses)
click to toggle source
Set which rating classes will be used to rate the object using this module. Each class must implement the rater methods, see FiveStar::BaseRater
@example
class Film include FiveStar.rateable rate_with GoreRater, SwearingRater, SexRater # ... end
@param klasses [Class]
constants referencing classes to rate object included with
@return [undefined]
@see FiveStar::BaseRater
@api public
# File lib/five-star/rateable.rb, line 37 def rate_with(*klasses) @rating_klasses = Array(klasses) end
rating_klasses()
click to toggle source
Return which rating classes will be used to rate the object using this module.
@return [Array] list of classes to rate with
@see FiveStar.rateable
@api private
# File lib/five-star/rateable.rb, line 49 def rating_klasses @rating_klasses ||= [] end