Class: ActiveRedis::DirtyObjects::SortedSet

Inherits:
Array
  • Object
show all
Defined in:
lib/active_redis/dirty_objects/sorted_set.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Array

#dirty?, #initialize

Constructor Details

This class inherits a constructor from ActiveRedis::DirtyObjects::Array

Instance Attribute Details

#hashObject

Returns the value of attribute hash.



4
5
6
# File 'lib/active_redis/dirty_objects/sorted_set.rb', line 4

def hash
  @hash
end

#originalObject (readonly)

Returns the value of attribute original.



5
6
7
# File 'lib/active_redis/dirty_objects/sorted_set.rb', line 5

def original
  @original
end

Instance Method Details

#[]=(score, value) ⇒ Object



7
8
9
10
11
# File 'lib/active_redis/dirty_objects/sorted_set.rb', line 7

def []=(score, value)
  self.push(score)
  @hash ||= {}
  @hash[value] = score
end

#changesObject



13
14
15
# File 'lib/active_redis/dirty_objects/sorted_set.rb', line 13

def changes
  super.merge(hash: @hash)
end