Module: RedisModelExtension::Attributes

Defined in:
lib/redis-model-extension/attributes.rb

Overview

Attribues

modul for easier getting all attributes also for setting ang getting value instance variable

Instance Method Summary collapse

Instance Method Details

#to_argObject Also known as: args

take all arguments and send them out



10
11
12
13
14
15
# File 'lib/redis-model-extension/attributes.rb', line 10

def to_arg
  redis_fields_config.inject({}) do |args, (key, type)|
    args[key] = self.send(key)
    args
  end
end

#to_jsonObject

put arguments into json



20
21
22
# File 'lib/redis-model-extension/attributes.rb', line 20

def to_json
  to_arg.to_json
end