nateware / redis-objects

Map Redis types directly to Ruby objects
Artistic License 2.0
2.09k stars 229 forks source link

Direct setters for lists hashes and sets #250

Closed artinboghosian closed 4 years ago

artinboghosian commented 4 years ago

This PR adds functionality suggested in https://github.com/nateware/redis-objects/issues/246.

Lists, Sets and Hashes can now be directly assigned

class Foo
  include Redis::Objects

  list :my_list
  set :my_set
  hash_key :my_hash
end

foo = Foo.new
foo.my_list = [1, 2, 3]
foo.my_set = [1, 2, 3]
foot.my_hash = { key1: 'value1', key2: 'value2' }