Class: Perpetuity::Postgres::NegatedQuery
- Inherits:
-
Object
- Object
- Perpetuity::Postgres::NegatedQuery
- Defined in:
- lib/perpetuity/postgres/negated_query.rb
Instance Attribute Summary collapse
-
#query ⇒ Object
readonly
Returns the value of attribute query.
Instance Method Summary collapse
-
#initialize(&block) ⇒ NegatedQuery
constructor
A new instance of NegatedQuery.
- #to_db ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(&block) ⇒ NegatedQuery
Returns a new instance of NegatedQuery.
8 9 10 |
# File 'lib/perpetuity/postgres/negated_query.rb', line 8 def initialize &block @query = Query.new(&block) end |
Instance Attribute Details
#query ⇒ Object (readonly)
Returns the value of attribute query.
6 7 8 |
# File 'lib/perpetuity/postgres/negated_query.rb', line 6 def query @query end |
Instance Method Details
#to_db ⇒ Object
12 13 14 |
# File 'lib/perpetuity/postgres/negated_query.rb', line 12 def to_db "NOT (#{query.to_db})" end |
#to_s ⇒ Object
16 17 18 |
# File 'lib/perpetuity/postgres/negated_query.rb', line 16 def to_s to_db end |