Module: RedisModel::ClassAttribute
- Defined in:
- lib/redis_model/class_attribute.rb
Overview
Public: Implementations for class-level RedisModel attributes.
Example:
class User < ActiveRecord::Base
include RedisModel::ClassAttribute
redis_class_attribute :registration_count, :counter
end
User.registration_count.incr
User.registration_count.to_i # Now it is set to 1
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
Class Method Details
.included(klass) ⇒ Object
46 47 48 |
# File 'lib/redis_model/class_attribute.rb', line 46 def self.included(klass) klass.extend ClassMethods end |