Class: CmisServer::Query::ParsedStatement
- Inherits:
-
Object
- Object
- CmisServer::Query::ParsedStatement
- Defined in:
- lib/cmis_server/query/simple_parser.rb
Overview
Data structures for parsed statement
Instance Attribute Summary collapse
-
#from_clause ⇒ Object
Returns the value of attribute from_clause.
-
#order_by ⇒ Object
Returns the value of attribute order_by.
-
#select_list ⇒ Object
Returns the value of attribute select_list.
-
#where_clause ⇒ Object
Returns the value of attribute where_clause.
Instance Method Summary collapse
-
#initialize ⇒ ParsedStatement
constructor
A new instance of ParsedStatement.
-
#query_expression ⇒ Object
Convert to format expected by existing code.
Constructor Details
#initialize ⇒ ParsedStatement
Returns a new instance of ParsedStatement.
183 184 185 186 187 188 |
# File 'lib/cmis_server/query/simple_parser.rb', line 183 def initialize @select_list = [] @from_clause = nil @where_clause = nil @order_by = [] end |
Instance Attribute Details
#from_clause ⇒ Object
Returns the value of attribute from_clause.
181 182 183 |
# File 'lib/cmis_server/query/simple_parser.rb', line 181 def from_clause @from_clause end |
#order_by ⇒ Object
Returns the value of attribute order_by.
181 182 183 |
# File 'lib/cmis_server/query/simple_parser.rb', line 181 def order_by @order_by end |
#select_list ⇒ Object
Returns the value of attribute select_list.
181 182 183 |
# File 'lib/cmis_server/query/simple_parser.rb', line 181 def select_list @select_list end |
#where_clause ⇒ Object
Returns the value of attribute where_clause.
181 182 183 |
# File 'lib/cmis_server/query/simple_parser.rb', line 181 def where_clause @where_clause end |
Instance Method Details
#query_expression ⇒ Object
Convert to format expected by existing code
191 192 193 194 195 196 197 198 199 200 201 202 203 |
# File 'lib/cmis_server/query/simple_parser.rb', line 191 def query_expression OpenStruct.new( from: OpenStruct.new( tables: [@from_clause].map { |fc| OpenStruct.new( name: fc.table_name, is_a?: ->(klass) { klass == CmisServer::Query::Statement::Table } ) } ), where: @where_clause ) end |