Class: NoBrainer::Document::AtomicOps::PendingAtomicSet

Inherits:
PendingAtomicContainer show all
Defined in:
lib/no_brainer/document/atomic_ops.rb

Instance Attribute Summary

Attributes inherited from PendingAtomic

#type

Instance Method Summary collapse

Methods inherited from PendingAtomicContainer

#&, #add, #delete, #difference, #intersection, #union, #|

Methods inherited from PendingAtomic

_new, #compile_rql_value, #default_value, #initialize, #initialize_copy, #inspect, #method_missing, #modify_source!, #to_s

Constructor Details

This class inherits a constructor from NoBrainer::Document::AtomicOps::PendingAtomic

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class NoBrainer::Document::AtomicOps::PendingAtomic

Instance Method Details

#+(value) ⇒ Object



105
106
107
108
# File 'lib/no_brainer/document/atomic_ops.rb', line 105

def +(value)
  @ops << [:set_union, [value.to_a]]
  self
end

#-(value) ⇒ Object



110
111
112
113
# File 'lib/no_brainer/document/atomic_ops.rb', line 110

def -(value)
  @ops << [:set_difference, [value.to_a]]
  self
end

#<<(value) ⇒ Object



99
100
101
102
103
# File 'lib/no_brainer/document/atomic_ops.rb', line 99

def <<(value)
  @ops << [:set_union, [[value]]]
  modify_source!
  self
end