Module: RedisColumn::Record::ClassMethods

Defined in:
lib/redis-column.rb

Instance Method Summary collapse

Instance Method Details

#redis_column(column_name) ⇒ Object Also known as: redis_col

Setup a redis column



44
45
46
47
48
# File 'lib/redis-column.rb', line 44

def redis_column column_name
  self.redis_columns += [column_name]
  define_method(column_name) { @attributes[column_name.to_s] }
  define_method("#{column_name}=") {|val| @attributes[column_name.to_s] = val }
end