Class: Perpetuity::Postgres::Query
- Inherits:
-
Object
- Object
- Perpetuity::Postgres::Query
- Defined in:
- lib/perpetuity/postgres/query.rb
Instance Attribute Summary collapse
-
#klass ⇒ Object
readonly
Returns the value of attribute klass.
-
#query ⇒ Object
readonly
Returns the value of attribute query.
Instance Method Summary collapse
-
#initialize(&block) ⇒ Query
constructor
A new instance of Query.
- #method_missing(name) ⇒ Object
- #to_db ⇒ Object
- #to_s ⇒ Object
- #to_str ⇒ Object
Constructor Details
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name) ⇒ Object
29 30 31 |
# File 'lib/perpetuity/postgres/query.rb', line 29 def method_missing name QueryAttribute.new(name) end |
Instance Attribute Details
#klass ⇒ Object (readonly)
Returns the value of attribute klass.
7 8 9 |
# File 'lib/perpetuity/postgres/query.rb', line 7 def klass @klass end |
#query ⇒ Object (readonly)
Returns the value of attribute query.
7 8 9 |
# File 'lib/perpetuity/postgres/query.rb', line 7 def query @query end |
Instance Method Details
#to_db ⇒ Object
17 18 19 |
# File 'lib/perpetuity/postgres/query.rb', line 17 def to_db query.call(self).to_db end |
#to_s ⇒ Object
25 26 27 |
# File 'lib/perpetuity/postgres/query.rb', line 25 def to_s to_db end |
#to_str ⇒ Object
21 22 23 |
# File 'lib/perpetuity/postgres/query.rb', line 21 def to_str to_db end |