Class: UnaryQ

Inherits:
Q show all
Defined in:
lib/dolzenko/django_q_object.rb

Direct Known Subclasses

NotQ

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Q

#&, #|, #~

Constructor Details

#initialize(*args) ⇒ UnaryQ

Returns a new instance of UnaryQ.



60
61
62
# File 'lib/dolzenko/django_q_object.rb', line 60

def initialize(*args)
  self.op1 = (args.size == 1 ? args[0] : args)
end

Instance Attribute Details

#op1Object

Returns the value of attribute op1.



58
59
60
# File 'lib/dolzenko/django_q_object.rb', line 58

def op1
  @op1
end

Instance Method Details

#empty?Boolean

Returns:

  • (Boolean)


68
69
70
# File 'lib/dolzenko/django_q_object.rb', line 68

def empty?
  op1.empty?
end

#to_q_sql(klass) ⇒ Object



64
65
66
# File 'lib/dolzenko/django_q_object.rb', line 64

def to_q_sql(klass)
  klass.send(:sanitize_sql, op1)
end