Class: NoBrainer::Document::AtomicOps::PendingAtomicContainer

Inherits:
PendingAtomic
  • Object
show all
Defined in:
lib/no_brainer/document/atomic_ops.rb

Direct Known Subclasses

PendingAtomicArray, PendingAtomicSet

Instance Attribute Summary

Attributes inherited from PendingAtomic

#type

Instance Method Summary collapse

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



78
79
80
81
# File 'lib/no_brainer/document/atomic_ops.rb', line 78

def &(value)
  @ops << [:set_intersection, [value.to_a]]
  self
end

#add(v) ⇒ Object



88
# File 'lib/no_brainer/document/atomic_ops.rb', line 88

def add(v);          self + v; end

#delete(value) ⇒ Object



93
94
95
# File 'lib/no_brainer/document/atomic_ops.rb', line 93

def delete(value)
  difference([value])
end

#difference(v) ⇒ Object



89
# File 'lib/no_brainer/document/atomic_ops.rb', line 89

def difference(v);   self - v; end

#intersection(v) ⇒ Object



90
# File 'lib/no_brainer/document/atomic_ops.rb', line 90

def intersection(v); self & v; end

#union(v) ⇒ Object



91
# File 'lib/no_brainer/document/atomic_ops.rb', line 91

def union(v);        self | v; end

#|(value) ⇒ Object



83
84
85
86
# File 'lib/no_brainer/document/atomic_ops.rb', line 83

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